WebVirtCloud is a powerful web-based management tool for KVM virtualization. It provides administrators and users with a convenient way to create, manage, and delete Virtual Machines running on a KVM hypervisor through a user-friendly web interface. Built on Django, WebVirtCloud offers user-based authorization and authentication, making it a secure and efficient choice for managing multiple QEMU/KVM Hypervisors, Hypervisor networks, and datastore pools from a single installation.
In this comprehensive tutorial, we will guide you through the step-by-step process of installing the WebVirtCloud KVM Management tool on Ubuntu 20.04. By the end of this tutorial, you will have a fully functional WebVirtCloud setup on your Ubuntu server, enabling you to effortlessly manage your virtual machines with ease.
Prerequisites
Before we begin the installation process, let’s ensure that we have met all the prerequisites:
- A server running Ubuntu 20.04.
- A root password is configured on the server.
Getting Started
To start the installation process, we need to update our system packages to the latest versions. Open your terminal and execute the following command:
apt-get update -y
Once the update process is complete, we can proceed to the next step.
Verify Virtualization Support
Before we dive into the installation, it is crucial to verify whether your operating system supports hardware virtualization. Run the following command in your terminal:
grep -E -c "vmx | svm" /proc/cpuinfo
If the output is greater than zero, congratulations! Your operating system supports hardware virtualization. If not, you may need to enable virtualization in your server’s BIOS settings.
Next, let’s check if your system is capable of running KVM virtual machines. Install the cpu-checker
package with the following command:
apt-get install cpu-checker -y
Once the installation is complete, run the following command to verify:
kvm-ok
If everything is set up correctly, you should see the following output:
INFO: /dev/kvm exists KVM acceleration can be used
With virtualization support confirmed, we can now proceed to install the KVM hypervisor.
Install KVM Hypervisor
To install KVM on your Ubuntu 20.04 server, execute the following command in your terminal:
apt-get install qemu qemu-kvm libvirt-daemon bridge-utils virt-manager virtinst -y
Once the installation is complete, we need to verify if the KVM module has been loaded. Run the following command:
lsmod | grep -i kvm
If the output shows kvm_intel
and kvm
modules, it means that the KVM module has been successfully loaded.
Additionally, let’s check the status of the libvirtd
service by running the following command:
systemctl status libvirtd
Ensure that the service is active and running without any errors.
Install Nginx and Other Packages
In order to complete the installation of WebVirtCloud, we need to install Nginx, Python, and other required packages. Execute the following command:
apt-get install git virtualenv python3-virtualenv python3-dev python3-lxml libvirt-dev zlib1g-dev libxslt1-dev nginx supervisor libsasl2-modules gcc pkg-config python3-guestfs libsasl2-dev libldap2-dev libssl-dev -y
Once the installation is finished, we can move on to the next step.
Install and Configure WebVirtCloud
Now it’s time to install and configure WebVirtCloud on our Ubuntu 20.04 server. Let’s start by downloading the latest version of WebVirtCloud from the Git repository. Execute the following command to clone the repository:
git clone https://github.com/retspen/webvirtcloud
Once the download is complete, navigate to the webvirtcloud
directory and copy the sample settings.py
file:
cd webvirtcloud cp webvirtcloud/settings.py.template webvirtcloud/settings.py
To enhance security, we need to generate a secret key for the WebVirtCloud application. Run the following command to generate the secret key:
openssl rand-base64 32
Copy the generated secret key as we will need it later. Next, open the settings.py
file with your preferred text editor:
nano webvirtcloud/settings.py
Locate the line that starts with SECRET_KEY
and replace the existing value with the secret key we generated earlier. Save and close the file.
Now, let’s copy the WebVirtCloud configuration files to the appropriate directories. Execute the following commands:
cp conf/supervisor/webvirtcloud.conf /etc/supervisor/conf.d cp conf/nginx/webvirtcloud.conf /etc/nginx/conf.d
Now, navigate back to your home directory and move the webvirtcloud
directory to the /srv
directory:
cd.. mv webvirtcloud /srv/
To ensure proper ownership, run the following command:
chown -R www-data:www-data /srv/webvirtcloud/
We are almost there! Change your directory to webvirtcloud
and create a virtual environment:
cd /srv/webvirtcloud/ virtualenv -p python3 venv
Activate the virtual environment:
source venv/bin/activate
Install the required Python dependencies:
pip install -r conf/requirements.txt
Once all the dependencies are installed, run the migrate command to generate all the necessary tables:
python3 manage.py migrate
Deactivate the Python virtual environment:
deactivate
Set proper ownership to the webvirtcloud
directory:
chown -R www-data:www-data /srv/webvirtcloud/
Remove the default Nginx virtual host configuration file:
rm /etc/nginx/sites-enabled/default
Restart the Nginx and Supervisor services to apply the changes:
systemctl restart nginx systemctl restart supervisor
Verify the status of Nginx to ensure everything is running smoothly:
systemctl status nginx
Great! Now that we have successfully installed and configured WebVirtCloud, we can proceed to access the web interface.
Access WebVirtCloud
To access the WebVirtCloud web interface, open your web browser and enter the URL http://your-server-ip
. You will be redirected to the WebVirtCloud login page.
Enter the default username and password, which are admin/admin
, and click on the Sign In button. You should now see the WebVirtCloud dashboard, where you can start creating and managing your virtual machines.
Conclusion
Congratulations! You have successfully installed and set up WebVirtCloud on your Ubuntu 20.04 server. With WebVirtCloud, you can now efficiently manage your KVM virtual machines through a user-friendly web interface, providing you with greater control and flexibility.
Remember to always stay updated with the latest security patches and best practices to ensure the stability and security of your virtualized environment.
If you have any further questions or need assistance, feel free to reach out to our support team at Shape.host. We offer reliable and scalable Linux SSD VPS hosting solutions to meet your business needs.