Install CentOS 7 to a Hyper-V VM

Post date: Jan 08, 2017 3:37:48 AM

Before configuring a remote Linux system, you can use a local VM for testing.

Prerequisites

    • Windows computer with Hyper-V installed and virtual switch configured.

    • Choose a storage location with enough free space, i.e. C:\VMs\.

    • Choose a hostname and IP address for the new system.

Download

Browse to http://isoredirect.centos.org/centos/7/isos/x86_64/.

Browse to a mirror, and download the DVD ISO, such as CentOS-7-x86_64-DVD-1611.iso

Move the ISO image to C:\VMs\ISO\.

Create the VM

Click "Start", find "Hyper-V Manager", and run it.

Select "Action" menu, "New", "Virtual Machine...".

Enter the hostname for the "Name".

Select "Store the virtual machine in a different location", and click "Browse...".

Browse to C:\VMs\, click "Select Folder", and click "Next >".

Select "Generation 2", and click "Next >".

Enter the RAM in MB, i.e. 8192, and click "Next >".

Select the virtual switch, and click "Next >".

Enter a size in GB, i.e. 64, and click "Next >".

Select "Install an operating system from a bootable image file", and click "Browse...".

Navigate to the CentOS ISO image, select it, and click "Open".

Click "Next >", and "Finish".

Configure VM Settings

In the Hyper-V Manager, right-click the new VM and select "Settings...".

Select "Security".

Unselect "Enable Secure Boot".

Select Processor.

Increase the number of virtual processors, if needed.

Click "OK".

Install CentOS

In the Hyper-V Manager, right-click the new VM and select "Connect".

Click the "Start" icon, or "Action" menu, "Start".

Select "Install CentOS 7", and press Enter.

After a minute, the "Welcome to CentOS 7" menu appears.

Click "Continue" to accept English language and keyboard.

Click "Network & Host Name".

Set the host name.

Next to "Ethernet (eth0)", connect the network by moving the slider from "Off" to On".

If you have a DHCP server, an IP address will be assigned. If not, click "Configure" and assign IPv4 settings.

Click "Done".

Click "Date and Time".

Select Region "Etc", City "Coordinated Universal Time".

Next to "Network Time", enable the NTP client by moving the slider from "Off" to "On".

Cick "Done".

Click "Installation Destination".

If you need custom partitions, configure them.

Click "Done".

Click "Begin Installation"

Click "Root Password".

Enter the root password, confirm it, and click "Done".

After installation completes (about 30 minutes), click "Reboot".

Connecting to CentOS

After reboot, log in as root.

Display the IP address:

ip addr

You can connect to this address with PuTTY.