CPU Extensions
Before we proceed, we need to check if the virtualization extensions are enabled on our CPU(s). To do that, use the following command, where vmx and svm are the virtualization flags on Intel and AMD processors, respectively:
No output means the extensions are either not available or not enabled in the BIOS. While you may continue without them, performance will be negatively impacted.
Install Virtualization Tools in Linux
To begin, let’s install the necessary tools. In CentOS you will need the following packages:
whereas in Ubuntu:
Next, we will download a CentOS 7 minimal ISO file for later use:
At this point we are ready to create our first virtual machine with the following specifications:
- RAM: 512 MB (Note that the host must have at least 1024 MB)
- 1 virtual CPU
- 8 GB disk
- Name: centos7vm
Depending on the computing resources available on the host, the above command may take some time to bring up the virtualization viewer. This tool will enable you to perform the installation as if you were doing it on a bare metal machine.
How to Manage Virtual Machines in Linux
After you have created a virtual machine, here are some commands you can use to manage it:
List all VMs:
Get info about a VM (centos7vm in this case):
Edit the settings of centos7vm in your default text editor:
Enable or disable autostart to have the virtual machine boot (or not) when the host does:
Stop centos7vm:
Once it is stopped, you can clone it into a new virtual machine called centos7vm2:
And that’s it. From this point on, you may want to refer to the virt-install, virsh, and virt-clone man pages for further info.
No comments:
Post a Comment