This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
manuals:vps:kvm [2016/10/30 14:44] – created toms | manuals:vps:kvm [2023/10/20 11:04] (current) – rene.la | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using KVM on vpsFree.cz | ====== Using KVM on vpsFree.cz | ||
+ | VPS are [[information: | ||
+ | which is shared between all VPS. In case you need your own kernel or if you'd like to use a different | ||
+ | operating system, you can create your own virtual machines inside the VPS using QEMU/KVM. | ||
- | This information page contains manuals on how to install and run KVM on Alpine Linux 3.4+, CentOS 7 and Debian 8. | + | ===== Configuration ===== |
- | First, go the details of your VPS in vpsAdmin and turn on the following | + | Go to the details of your VPS in vpsAdmin and turn on the following |
- | * Bridge | + | * TUN/ |
- | * iptables – enables iptables, an option necessary to configure the IP masquerade, | + | |
* KVM – enables KVM (for hardware support of virtualization). | * KVM – enables KVM (for hardware support of virtualization). | ||
+ | ===== libvirt ===== | ||
+ | Virtual machines can be managed using [[https:// | ||
+ | with [[https:// | ||
+ | |||
+ | ===== Mount dataset export from NAS server to QEMU/KVM ==== | ||
+ | If you want to use a connected dataset export from a NAS server in to QEMU/KVM, for example to mount an ISO image of a CD for system boot, and you get this error message " | ||
+ | |||
+ | For example, if you use fstab to mount to the system: | ||
+ | |||
+ | 562.586.65.25:/ | ||
+ | |||
+ | You will now use the mount command as follows: | ||
+ | |||
+ | 562.586.65.25:/ | ||
+ | |||
+ | (**// | ||
===== KVM on Alpine Linux ===== | ===== KVM on Alpine Linux ===== | ||
Line 142: | Line 160: | ||
* [[jakub@jirutka.cz|Jakub Jirůtka]] (on [[irc:// | * [[jakub@jirutka.cz|Jakub Jirůtka]] (on [[irc:// | ||
- | |||
- | ===== KVM on CentOS 7 ===== | ||
- | |||
- | <note warning> | ||
- | This manual can only be used for CentOS 7.1. The internal network between VPS and VM currently isn’t working on CentOS 7.2. Until this problem is solved, please use either CentOS 7.1 or Debian 8. | ||
- | </ | ||
- | |||
- | I use KVM using libvirt on an updated CentOS 7. | ||
- | |||
- | I recommend fully updating CentOS 7, configuring it and installing the required software. Because of iptables permissions, | ||
- | |||
- | <code shell> | ||
- | yum group install virtualization-host-environment | ||
- | yum install virt-manager xauth | ||
- | systemctl enable libvirtd | ||
- | systemctl disable firewalld | ||
- | reboot | ||
- | </ | ||
- | |||
- | ==== Creating a Virtual Machine Using virt-manager on the Side of the Server ==== | ||
- | |||
- | Motivation: When you’re working on a slow connection (which the ADSL that the O2 provides in villages definitely is), you will need to minimize the data flow through your primary computer. The local virt-manager would download at least the kernel and initramdisk using the relatively slow download speed. The typically extremely slow upload speed would be used to upload to the host container. | ||
- | |||
- | <code shell> | ||
- | ssh root@your-host-name -Y virt-manager | ||
- | </ | ||
- | |||
- | You can start the installation on the remote running instance. However, displaying the installer using the default SPICE doesn’t work for me. Since I think switching libvirt to VNC is extremely impractical, | ||
- | |||
- | |||
- | ===== KVM on Debian 8 ===== | ||
- | |||
- | This manual was made using Debian 8. It should function without issues on CentOS as well (with different commands, see above). I have tried to run KVM on Ubuntu 14.04, but sadly, to no avail. | ||
- | |||
- | If you’re using Windows, you need to install and turn on Xming (if you at least want to install and configure the virtual machine using a graphical interface, like I did). Then we start Putty (don’t forget to run Xming and select the “Enable X11 forwarding” option) and let the magic begin. | ||
- | |||
- | We’ll start with the usual: | ||
- | |||
- | <code shell> | ||
- | apt-get update | ||
- | apt-get upgrade | ||
- | </ | ||
- | |||
- | Then we install the libvirt library: | ||
- | <code shell> | ||
- | apt-get install qemu-kvm libvirt-bin | ||
- | apt-get install virt-manager | ||
- | </ | ||
- | Altogether, these two packages should be around 320 MB. The next step is downloading the image of the distribution that we want to install on the virtual machine. I installed Ubuntu Server 14.04. Choose the folder where you want to download the image and download the ISO image using “wget”. | ||
- | <code shell> | ||
- | cd /home | ||
- | wget http:// | ||
- | </ | ||
- | Run virt-manager. | ||
- | <code shell> | ||
- | virt-manager | ||
- | </ | ||
- | Using Xming, you can now use Windows to configure and start the installation of the virtual server on your VPS remotely. Note that the SPICE display doesn’t work under X11, so if you want to use a graphical interface to install the virtual machine, you need to select the “Display VNC” option in the settings and restart the virtual machine. If you do this and restart the server, it can lose the information that the .iso image for the installation has been connected, so you will have to go back to the settings of the “CD-ROM” tab and in “Source-path” connect the .iso image for the installation again. | ||
- | |||
- | |||
- | ==== Contacts ==== | ||
- | |||
- | * [[: |