This list is by no means comprehensive, but the listed commands are the required ones to make things happen!
Assume the following:
- Intel Xeon X3220 Quad Core Server
- 8 GB of ECC RAM
- 750GB Seagate RAID 1 array
- Dual Gigabit NICs
- DVDROM Optical
- Server 2008 setup names the server: WIN-35CVS22
Once the Server 2008 Core install has been completed one will be greeted with the Logon for admin. From there:
- Out of the box the Admin password is blank. Set a new password for the local admin account that meets password complexity requirements.
- Find the new server's name:
- hostname [Assume Enter after each line]
- Rename the server to our pending production name:
- netdom RenameComputer WIN-35CVS22 /NewName:TN-CoreVS01
- shutdown -r -t 05
- Configure our partitions:
- DiskPart
- Select Disk 0
- Create Par Primary Size=13312
- Sel Par 2 (assuming partition 1 is the system drive)
- format fs=ntfs label="SwapFile"
- assign letter=S
- Create Par Primary (no size specified as the balance will be taken)
- Sel Par 3
- format fs=ntfs label="VirtualMachines" Quick (No Quick means a long wait)
- assign letter=G
- list vol (should see optical, C:, S:, and G:)
- exit [Enter]
- Move the Swap File over to the S: partition:
- wmic computersystem where name="TN-CoreVS01" set AutomaticManagedPagefile=False
- wmic pagefileset where name=”S:\\pagefile.sys” set InitialSize=8192,MaximumSize=12288
- If the pagefileset command gives you grief, reboot, then try the command again and it should work.
- shutdown -r -t 05
- Join the SBS domain and place the server in a custom OU:
- netdom Join TN-CoreVS01 /Domain:MySBSDomain.Local
/OU:OU=SBSServers,OU=Computers,OU=MyBusiness,DC=Domain,DC=Local
/UserD:MySBSAdmin
/PasswordD:* (asterisk will prompt for the password) - If the command fails, check for typos.
- shutdown -r -t 05
- Post reboot login: MyDomainAdmin@MySBSDomain + password
- Create and share the base virtual machine folder:
- G:
- MkDir VMs (name whatever you like)
- net share VirtualMachines=G:\VMs /Grant:"MySBSDomain\Domain Admins",FULL /Remark:"My Virtual Machines"
- Net Share VirtualMachines (lists all settings relevant to the share)
- Install the Hyper-V role then update it:
- bcdedit /set hypervisorlaunchtype auto
- start /w OCSetup Microsoft-Hyper-V (Case Sensitive and a restart is required)
- On another system: Download the Hyper-V current release to a network share (assume M: via logon script)
- M: (location of the Hyper-V update bits)
- CD Microsoft\Hyper-V (relevant folder for you)
- Windows6.0-KB950050-x64-Hyper-V.msu (update will run and restart)
- Setup Windows Networking - Static IP and network DNS Server:
- On the domain DHCP server setup reservations for the planned IPs needed for the 2 NICs.
- ipconfig to get the currently assigned IP addresses in relationship to the NIC name.
- netsh interface ipv4 show interfaces (note Idx number)
- netsh interface ipv4 set address name="3" source=static address=192.168.37.250 mask=255.255.255.0 gateway=192.168.37.1
- netsh interface ipv4 add dnsserver name="3" address=192.168.37.2 index=1
- For the following, hit the F3 key (DOSKey for those who remember), then the up arrow key to scroll through previously used commands to make things easier than retyping everything. Just change the relevant IP setting.
- netsh interface ipv4 set address name="7" source=static address=192.168.37.249 mask=255.255.255.0 gateway=192.168.37.1
- netsh interface ipv4 add dnsserver name="7" address=192.168.37.2 index=1 (please ignore wrapping)
- IPConfig /all to verify settings.
- Configure the Windows Firewall (MS KB947709) to allow RDP, folder sharing, and remote admin:
- netsh advfirewall firewall set rule name="Remote Administration (RPC-EPMAP)" new enable=yes profile=domain
- netsh advfirewall firewall set rule name="Remote Administration (NP-In)" new enable=yes profile=domain
- netsh advfirewall firewall set rule name="Remote Administration (RPC)" new enable=yes profile=domain
- netsh advfirewall firewall set rule name="remote desktop (tcp-in)" new enable=Yes profile=domain
- This is the correct syntax for this one ... not the original in the post that came from the above KB article that has been struck out. Plus, a couple of extras were needed to make things complete.
- NOTE: Check the current assigned profile and change the above profile setting as appropriate: netsh advfirewall show currentprofile
- NetSH Reference Post.
- Enable remote firewall management:
- Netsh advfirewall firewall set rule group=“Windows Firewall Remote Management” new enable=yes
- Enable Terminal Services Admin:
- cscript c:\Windows\System32\Scregedit.wsf /ar 0
- Test by mstsc /v:TS-CoreVS01 (from a remote workstation)
- Update the Server Core installation (previous blog post).
- If ISOs reside on a network share, configure the Hyper-V server to access the share via Constrained Delegation (previous blog post).
Now that we have a good grasp on what commands are required to complete a Hyper-V setup on Server Core, we can place all of the above commands into a series of batch files that can be ran at each step. Some quick modifications to tailor things such as names and not leaving our domain admin password in a plain text file would be a good thing.
Batching the above command sets would reduce the amount of time required to run post OS install setup steps significantly. It would also save us from having to retype that command or hitting the F3 key to bring it back to edit it yet again! ;)
With the Hyper-V Manager we are able to create, modify, update, and delete any virtual machines associated with any Hyper-V enabled Server 2008 instance on our domain. One can also use an MMC on Vista to connect to the Server Core machine and manage its settings to some degree.
The first task post Hyper-V Manager install on Vista SP1 is to change the default directories under Hyper-V Settings for the Virtual Hard Disks folder and Virtual Machines folder (configuration file folder) to:
- Virtual Hard Disks: G:\VMs\Virtual Hard Disks
- Virtual Machines: G:\VMs\Hyper-V
- start /w slmgr.vbs -ipk ABCDE-FGHIJ-KLMNO-PQRST-UVWXY
- start /w slmgr.vbs -ato
UPDATE: Missed the Windows Networking setup step.
UPDATE 2008-09-01: Added the initial step to discover the host name, added the update Server Core step, and some minor tweaks to the commands. Updated the firewall rules to reflect the proper syntax.
UPDATE 2008-10-30: Added the Exit command for the DiskPart command set, and a link to our previous post on moving the swapfile in Server Core.
UPDATE 2009-02-20: Added the Constrained Delegation step as well as the opening up of the Windows Advanced Firewall to remote management step.
Philip Elder
MPECS Inc.
Microsoft Small Business Specialists
*All Mac on SBS posts are posted on our in-house iMac via the Safari Web browser.
I am working on a Hyper-V 2008 server install. Your comments here are a GREAT help. I am wondering about a couple things as I fumble through this.
ReplyDelete1: How to decide how much disk space to alocate to Hyper-V Server 2008, I chose 75 gig for no apparent reason.
2: I have 16 gigs of ram, so am making the swap partition 25 gigs. Not sure the thought process I should have on this. Not sure of the whole Swapfile in a seperate partition concept. It seems like a good idea...
Fischnets,
ReplyDeleteWe do 35GB for the OS.
With Hyper-V being the only role installed, and lots of RAM in the server then it is safe to say not too much in the way of Swap File action will be happening.
The Windows Performance Team Blog has a great discussion on the swap file and how to configure it.
Keeping the swap file in its own partition eliminates any performance degredation due to the file being fragmented over time.
Thanks for the comment!
Philip
Have you ever managed to configure the Wake On Lan features of your Hyper-V server NICs ? We have a couple of Hyper-V servers hosting test machines and located remotely. These servers can remain unused for weeks so we would like to shut them down but be able to wake them up when needed. The server we use are Dell PowerEdge 610 with embedded Broadcom BCM5709 cards.
ReplyDeleteXavier,
ReplyDeleteInstall a Dell DRAC to remotely power cycle the servers.
Or, if the unit cannot take a DRAC, a PDU capable of plugging into the network that allows you to remotely power cycle the power socket to wake up the server. The BIOS setting for power events needs to be set to turn the server on.
Philip
Greetings,
ReplyDeleteI'm doing a few hyper-v boxes, and the guide is very helpful, however, one of the things missing (or something I didn't see, at any rate) was configuring ipv6. Thoughts?
~Nick
Hi,
ReplyDeleteThank you for this documentation! It helped me out plenty. I have a question: I can't seem to grant permission to a directory which I have created. It keeps coming back with "Net Share syntax command is."
net share example=s:\example /grant:"mydomain\domain admins", FULL
I'm running hyper-v server 2008 R2
is there something i'm missing?
thanks.
jimmy
Great walkthrough! I'm having trouble with the swapfile, though. I seem to be running into the same problem you were having before you found the team blog you referenced. I'm able to set the autopagefile to True or False successfully, but even after rebooting, I'm getting a "No Instance(s) Available" message. I've paid VERY close attention to syntax, spaces, and have even attempted different sizes. Any thoughts or recommendations?
ReplyDeleteThanks,
Ryan
Ryan,
ReplyDeleteIn the pagefile post that is linked, dig down into the comments to Sander's command set. Note the "Create" step.
That will fix the problem. I need to update that post!
Philip