User Tools

Site Tools


manuals:vps:kvm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
manuals:vps:kvm [2016/10/30 14:44] – created tomsmanuals: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:vpsadminos|linux containers]], i.e. there is only one kernel running on every node,
 +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 options:+Go to the details of your VPS in vpsAdmin and turn on the following features:
  
-  * Bridge – enables the creation of a network bridge that the KVM virtual machines will be connected to later, +  * TUN/TAP – enables the creation of virtual interfaces,
-  * 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://libvirt.org|libvirt]]
 +with [[https://virt-manager.org|virt-manager]].
 +
 +===== 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 "Failed to lock byte 100: No locks available", the given export must be mounted on the host system with the flag " nolock".
 +
 +For example, if you use fstab to mount to the system:
 +
 +  562.586.65.25:/nas/4562 /mnt/export4562 nfs vers=3,nofail 0 0
 +
 +You will now use the mount command as follows:
 +
 +  562.586.65.25:/nas/4562 /mnt/export4562 nfs vers=3,nofail,nolock 0 0
 +
 +(**//562.586.65.25//** > Address of your NFS server; **//4562//** > number of your dataset on NFS server)
  
 ===== KVM on Alpine Linux  ===== ===== KVM on Alpine Linux  =====
Line 142: Line 160:
  
   * [[jakub@jirutka.cz|Jakub Jirůtka]] (on [[irc://chat.freenode.net/vpsfree|#vpsfree]] under the name “jirutka”)   * [[jakub@jirutka.cz|Jakub Jirůtka]] (on [[irc://chat.freenode.net/vpsfree|#vpsfree]] under the name “jirutka”)
- 
-===== 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. 
-</note> 
- 
-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, it is necessary to either configure or turn off firewalld. 
- 
-<code shell> 
-yum group install virtualization-host-environment 
-yum install virt-manager xauth 
-systemctl enable libvirtd 
-systemctl disable firewalld 
-reboot 
-</code> 
- 
-==== 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 
-</code> 
- 
-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, I recommend running virt-manager locally and adding the path to the server for both the installation and further use. 
- 
- 
-===== 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 
-</code> 
- 
-Then we install the libvirt library: 
-<code shell> 
-apt-get install qemu-kvm libvirt-bin 
-apt-get install virt-manager 
-</code> 
-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://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-server-amd64.iso 
-</code> 
-Run virt-manager. 
-<code shell> 
-virt-manager 
-</code> 
-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.  The next step is installing the chosen Linux distro. The only action left is setting up the correct port forwarding on your VPS so that you can access your virtual machine using the VPS from the outside. 
- 
- 
-==== Contacts ==== 
- 
-  * [[:uzivatele/pavlix]] 
manuals/vps/kvm.1477838690.txt.gz · Last modified: 2016/10/30 14:44 by toms