How to Install CentOS Linux on Hyper-V Virtual Machine in Windows 10
Note
A working and quite nice alternative for dual booting is to install various operating systems on a virtual machine. CentOS is officially supported by Microsoft as a guest OS for Hyper-V and is nicely integrated when installed. Since CentOS version 6.4 the Linux Integration Services (LIS) for Hyper-V have been included in CentOS, making the use of it on a virtual machine much easier.
About LIS:
Linux Integration Services v35.pdfMicrosoft said:
Although there are more suitable Linux distos for beginners, CentOS is easy enough to install and use with very basic knowledge of Linux. The native integration components and services make it an ideal guest for Hyper-V.
CentOS on Wikipedia: CentOS - Wikipedia, the free encyclopedia
Before starting you need to download the CentOS 7 ISO image: Download CentOS (version 7 is the latest at the moment this tutorial is written).
Contents:
- Part One: Create a new virtual machine
- Part Two: Configure temporary network access
- Part three: Configure CentOS
- Part four: Install CentOS, create users
- Part Five: Configure network access
- Part Six: Enjoy!
1.1) If you have not set up Hyper-V do it now as told in Hyper-V tutorial Part One through Part Three
1.2) Create a new virtual machine as told in Hyper-V tutorial Part Four with following settings (steps here referring to respective steps in Hyper-V tutorial):
- Step 4.5 > If you have less than 4 GB RAM on your host, assign the vm 1 GB (1024 MB) and unselect Use Dynamic Memory. When Dynamic Memory is enabled CentOS uses quite a lot of RAM and can slow down your host system. I recommend enabling Dynamic Memory only if you have more than 4 GB of RAM
- Step 4.6 > Select Not Connected
- Step 4.7 > If you will only use your CentOS for some simple testing, surfing and so on, an 8 to 10 GB virtual hard disk is enough, I recommend 20 to 30 GB
- Step 4.8 > Use the CentOS ISO file you downloaded
- Come back to this tutorial after Step 4.9
2.1) To be sure CentOS has network connection during the installation we use a virtual legacy network adapter. Right click your new CentOS vm in Hyper-V Manager and select Settings
2.2) Remove the network adapter:
2.3) Still in vm settings, select Add Hardware on left pane, select Legacy Network Adapter and click Add:2.4) Select an existing external switch, click OK to save changed settings:
3.1) Double click your CentOS vm in Hyper-V Manager to open the Virtual Machine Connection window, click Start button to boot the vm. Alternative method to start a vm, see the Hyper-V tutorial Part Four Step 4.103.2) Press I (letter i) followed by Enter to start setup:
3.2) First message you will get is an error message: Fast TSC calibration failed. No worries this is totally OK; as CentOS has not had any chance to connect to time servers to calibrate time, this message will be shown. CentOS setup continues after a short while
3.3) Select the installation language you want CentOS to use:3.4) Installation Summary screen will be shown. We need to do something for those five items marked in below screenshot, starting with Network & Hostname (#1). Click it to enter Network and Hostname settings:3.5) Switch connection ON (#1), name your Host (#2), wait until you see that it's connected (green highlight in screenshot), click Done:
Note
The Hostname can only contain characters a to z, A to Z, 0 to 9, hyphens (-) and periods (.). Parts between two periods must contain something (two periods in a row not allowed) and cannot start or end with a hyphen.
3.6) Back on Installation Summary page click Date & Time to select your region, set timezone and time format as shown in screenshot below, click Done (top left) when done:3.7) If you use another input language (keyboard layout) than the default for the language you are installing, click Keyboard on Installation Summary page. Select your input language as shown in screenshot (don't panic, I'll explain all those arrows and numbers :)):
- Click the + button to open language list
- Select your desired input language
- Click Add
- Move your preferred input language to top of the list with arrow buttons
- Click Done
3.8) Back on Installation Summary page, select Software Selection. You can of course select any setup you want to, screenshot shows my recommnedation. Click Done when you have selected your packages:
3.9) Once again back on Installation Summary. Click Installation Destination, accept default partitioning settings by clicking Done:
4.1) Start installation by clicking Begin Installation:4.2) While CentOS installs we can set the root password and create a user account. Root in world of Linux is a rough equivalent of built-in administrator in Windows, the almighty user allowed to do whatever. The root password and at least one user account must be created for installation to complete.
4.3) Click Root Password:
4.4) Set the root password, click Done when ready:4.5) Next your personal user account. Click User Creation:4.6) Enter your preferred credentials, do not forget to make your account administrator (highlighted), click Done when ready:
4.7) Now just wait installation to complete. It can take some time, installing now to get screenshots for this tutorial it took over half an hour on quite a powerful host computer, mostly because all the packages I selected to install (Part Three Step 3.8). When installation is done click Reboot:
4.8) After the reboot you have to accept the EULA. Click License Information:
4.9) Accept the EULA, click Done:
4.10) Click Finish Configuration:4.11) Kdump is a program to collect information in case of crash. It can help in analyzing crashes but requires some of system memory. I recommend enabling Kdump but the decision is yours. Click Forward when you made your selection:
4.12) When finally on desktop you don't have network connectivity. To fix this we need first to shutdown the vm:
4.13) Wait until the shutdown progress indicator is all green and shutdown succeeded, then open vm settings from File > Settings:
5.1) In vm settings, select the Legacy Network Adapter we set up in Part Two and click Remove:
5.2) Select Add Hardware > Network Adapter (not the Legacy adapter we used earlier!), click Add:
5.3) Select the Network Adapter you just added, connect it to an existing external switch (see Hyper-V tutorial Part Three), click OK to save the settings:
Boot the vm, enjoy your newly installed CentOS Linux :).
If you have any questions do not hesitate to post them in this thread.
Kari
Related Tutorials
- How to Setup and Use Hyper-V in Windows 10 for OS Virtualization
- How to Create and Use Hyper-V Checkpoints in Windows 10
- How to Create VHD of Windows 10 Installation and Use in Hyper-V