How to Set Up a CentOS Virtual Machine on Windows

How to Set Up a CentOS Virtual Machine on Windows

What Do I Need?

  • A Dedicated or VPS Linux Server
  • CentOS

What is a Virtual Machine?

A virtual machine or VM is a virtual environment that works as a virtual computer system with its own processor, memory, network interface, and storage created on a physical hardware system, located off or on-premises. Software called Hypervisor separates the machine’s resources from the hardware so they can be actioned by the VM.

  1. Download CentOS ISO

    Visit https://www.centos.org/download/ to download the latest version of CentOS.Only download from verifiable mirrors.
  1. Create a Virtual Machine
    1. Open ‘Hyper-V Manager’.How to Set Up a CentOS Virtual Machine on Windows
    1. Next, click ‘New’ and select ‘Virtual Machine’ from the dropdown list.
    2. Click ‘Next’.How to Set Up a CentOS Virtual Machine on Windows
    1. Specify Name and Location: Give your virtual machine a name and click ‘Next’.How to Set Up a CentOS Virtual Machine on Windows
    1. Specify Generation: For most use cases I would recommend sticking with the recommended ‘Generation 1’ selection and click ‘Next’. ‘Generation 1’ offers the greatest range of backward and forward compatibility across the board.How to Set Up a CentOS Virtual Machine on Windows
    1. Assign Memory: For most use cases I’d recommend sticking with the default selection unless you know for a fact that you’re going to be needing to use more memory resources. ‘Dynamic Memory’ selection will ensure that if your virtual machine needs more resources it’ll get them.How to Set Up a CentOS Virtual Machine on Windows
    1. Configure Networking: Select the shared internet connection that you want the virtual machine to use and click ‘Next’.How to Set Up a CentOS Virtual Machine on Windows
    1. Connect Virtual Disk Drive: I’d suggest not interfering with the default selections unless you have a specific use case that requires it. Click ‘Next’.How to Set Up a CentOS Virtual Machine on Windows
    1. Installation Options: Select ‘Install an operating system from a bootable CD/DVD-ROM’, then pick the option for ‘Image File’ and navigate to where you’ve stored the previously downloaded ISO of CentOS and click ‘Next’.How to Set Up a CentOS Virtual Machine on Windows
    1. Completing the New Virtual Machine Wizard: Check your defaults and click ‘Finish’.
  1. Finish Operating System Installation
    1. Double-click your newly built virtual machine from the ‘Hyper-V Manager’.How to Set Up a CentOS Virtual Machine on Windows
    1. Select ‘Install CentOS Linux 8’.How to Set Up a CentOS Virtual Machine on Windows
    1. From this point on, you’re just following the standard CentOS installation process.

Next Steps

There are a number of things to be done post-installation. If you already know about Linux, this isn’t really a problem. Otherwise, it’s time to follow along blindly. Editing large text files is a huge part of the Linux world. Many purists prefer ‘vi’, bordering on mania or zealotry; however, personally, I prefer ‘nano’. It’s infinitely easier.

        sudo yum install -y nano

Then, I’d recommend enabling ‘Dynamic Memory In-Guest’. You can start by creating a ‘rules’ file. The location is important but the name isn’t. I’ll use the same one as the Microsoft instructions:

        sudo nano /etc/udev/rules.d/100-balloon.rules

You’ll be prompted for your password. You’ll now be looking at an empty file in your newly installed ‘nano’ editor. Add the following command:

        SUBSYSTEM==”memory”, ACTION==”add”, ATTR{state}=”online”

Now press ‘ctrl+x’ to exit, press ‘y’ to confirm, and ‘enter’ to confirm the filename. Reboot your server. At the next reboot, Dynamic Memory will be functional. Next, I’d recommend installing the ‘Extra Hyper-V Tools’. To install them:

sudo yum install -y hyperv-daemons

Change the ‘Disk I/O Scheduler’ so that it helps to optimize the disk write and read inputs and outputs. Hyper-V wants to optimize I/O too; two optimizers are infinitely worse than none and confusing as hell for the system. We should disable the default version in CentOS. Use the following commands:

su root
echo noop > /sys/block/sda/queue/scheduler
exit

Conclusion

There are a variety of reasons why you’d want a CentOS virtual machine. Hyper-V is a brilliant tool for virtualization and definitely the platform of choice for this and other use cases.

How To Set up a VSFTPD Server on a CentOS 7 VPS or Dedicated Server

Brief Description FTP is usually insecure exposing clear-text passwords, userna
less than a minute
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Brief Description FTP data is usually insecure since information (usernames, pa
less than a minute
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to use phpMyAdmin to develop a website (without MySQL experience)

Brief description A web developer who is not well versed into coding websites f
less than a minute
Idan Cohen
Idan Cohen
Marketing Expert

How to Install MySQL on a Windows Web Server Running Apache

This tutorial will show you how to install the MySQL database on a Windows serve
less than a minute
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top