Prerequisites
- Hyper-V is installed and you have a new VM set up. For help with this, see the post: Walk-through: Hyper-V on Windows Server 2008 R2.
- Install the Legacy Network Adapter for your VM instead of the default. To do this: In the “Settings” page of the VM, click “Add Hardware”. Select “Legacy Network Adapter” and “Add”. Select the network to connect it to from the list and hit “Apply” to save changes. At this point you can remove the other Network Adapter if your VM only needs one virtual NIC.
- Make sure that you have the installation media either on physical CD/DVDs or in the form of an .ISO or other supported image file and that the VM is set to boot from it. See the link above if you need help mounting the installation media.
Starting the Installer
- For the purposes of this walk-through, I will be using the “net install” version of the CentOS media. This will only work if your VM has a working internet connection during installation.
- Connect to your VM by right-clicking it and clicking “Connect…”
- Click the “Start” button on the toolbar to crank it up
- At the “boot:” prompt, type “linux text” and press enter. (graphical mode can get ugly in Hyper-V)
- Choose your language and keyboard layout.
- When prompted for the “Installation Method”, choose “HTTP”
- On the next screen you will get a chance to configure the TCP/IP settings of the virtual network interface. Set them up appropriate for your network and click “OK”.
- When prompted for the web site and directory, use the following:
- Web site name: mirror.centos.org
- CentOS directory: centos/5.5/os/x86_64
- NOTE: Your location may vary! I am installing the 64bit version of CentOS 5.5 in this example. If you were installing the 32bit version of CentOS 5.4, your directory would be “centos/5.4/os/i386”
- If the installer was able to access the server and directory, you should see a message welcoming you to CentOS!
Configuring CentOS
- The first thing the installer will want to do is set up the drives/partitions. I normally allow it to “Remove all partitions on selected drives and create default layout.” Since this is a virtual machine, we will assume that there is no dual-boot situation here or any reason to leave existing partitions intact. If you feel the need to choose a different scheme here, do so at your own risk.
- You will be asked to configure your NIC. Do so and make sure that IP4 is selected, as well as “Activate on boot”. IP6 is up to you.
- The next few prompts will be your standard NIC settings: DHCP vs. Manual, DNS settings, hostname, etc.
- Set your time zone when prompted.
- Set your root password. (NOTE: This is very very important. Make it strong and remember it!)
- The next section will be focused on package selection. Keep in mind that using the GUI on a linux guest in Hyper-V ranges from “no fun” to “non-functional”. I would stick to a bare bones install without Gnome or KDE. You may want to select “Customize software selection” to get some of the packages that you will be using installed right off the bat. Once you have made your selections, click “OK”.
- CentOS will now start downloading and installing the selected packages. When package installation is complete, you will be prompted to reboot the VM.
- When the VM reboots you should be greeted with the CentOS Setup Agent. If it brings you back to the installer, turn off the VM, go to “File->Settings” and set the DVD Drive Media to “None”. This is the equivalent of ejecting the CentOS installation CD. Start the VM again.
- The Setup Agent will allow you to further customize your system settings. Going into all of these settings is beyond the scope of this guide, but most are self-explanatory. At this point your CentOS virtual machine is installed and running. For more help configuring CentOS, visit centos.org or search this site for other articles about CentOS.
Leave a Reply