Showing posts with label kvm. Show all posts
Showing posts with label kvm. Show all posts

This tutorial is inspired by errors and fixes we encountered when testing openSUSE Leap 16 yesterday. The problem is a kernel panic at boot time, so we cannot run it the same way we usually run other GNU/Linux operating systems up to today. After looking up and re-reading our old articles, we found out a solution. We hope you can run Leap 16 on a virtual machine quickly and easily with this. Now let's start reading and practicing!

 

 

 (A QEMU virtual machine showing openSUSE bootloader with Install Leap 16.0 as an option highlighted in light green)

 

Subscribe to UbuntuBuzz Telegram Channel to get article updates.

This tutorial will explain for QEMU virtual machine users how you can make two-ways network connection between host and guest on Ubuntu Desktop. This enables internet access automatically for the guest if available on the host. This tutorial gives you an example exercise, that is, to remote login with SSH from host to guest and reversely from guest to host. Now let's start!

Subscribe to UbuntuBuzz Telegram Channel to get article updates.

We are fortunate to have a good virtual machine tool AQEMU on GNU/Linux operating systems. With AQEMU on your Ubuntu computer, you can virtualize any operating systems very easily. It can replace and works similarly to the proprietary tool VirtualBox or VMWare step by step as you can see in this tutorial. Now let's learn virtualization!

Subscribe to UbuntuBuzz Telegram Channel to get article updates.

We want to give an example about installing an operating system in a virtual machine created with QEMU/KVM. We will install Ubuntu 16.04 as guest on top of Ubuntu 16.04 as host. The GUI displayed by Virtual Machine manager (virt-manager). There are only 5 steps to prepare the virtual machine, after that the 6th step is the guest OS installation. This article is a continuation of our previous tutorial about installing QEMU/KVM and virt-manager in Ubuntu.

Preparation


  • Our hardware specification is Intel Celeron 1.8 GHz 32 bit, 2 GB RAM, 12 GB free space. 
  • We want to install Ubuntu 16.04 Xenial Xerus 32 bit inside a QEMU/KVM virtual machine.
  • Tools used in this tutorial are KVM as the hypervisor (kernel-space), QEMU as the machine emulator (user-space), and Virtual Machine Manager (virt-manager) as the display GUI. 
  • You better place the ISO image in the same partition as your $HOME partition. For example, we have /home/master/Downloads directory, and we put the ISO there. We don't put it in another partition to avoid any error. 
  • If you have not installed the tools needed, follow our previous tutorial about installing QEMU/KVM.

1. Add New VM


First step, press A New Virtual Machine button. This invokes a new window. Select Choose how: Local install media then select Architecture: i686. Press Forward button.


2. Add Ubuntu ISO


Second step, locate the ISO image of Ubuntu operating system you want to install. See picture below: (1) press Browse button (2) select directory source (3) select the ISO (4) press Choose Volume button. Remember that it is better if the ISO file is in the same partition as your $HOME directory.



3. Add RAM and CPU Amounts


Third step, adding virtual memory and CPU amounts. We choose 700 MB ram and 1 cpu. This depends on your own hardware capability. It is better to give the guest OS appropriate RAM but leave the host OS handles the most. It is better to don't give guest OS more than half of your total RAM. You may choose more or less. Press Forward button.


4. Add Virtual Disk Storage


Fourth step, create new or select already prepared virtual storage (virtual hard disk). If this is your first time to use KVM, press Manage button then follow the next picture.


A new window Choose Storage Volume appears. See picture below: (1) press green plus button then Add a Storage Volume window appears (2) choose the name for the virtual disk storage (3) set the storage size (4) press Finish button (5) select the generic.qcow file just created and press Choose Volume button.

Note: for (2) let it be default is enough; for (3) give it at least 4 GiB for Ubuntu Desktop; for (4) make sure you create the qcow2 file inside your $HOME partition not in another partition.


5. Creating Virtual Machine


Fifth step, you give the name for your virtual machine. For example, we name it Xenial because it runs Ubuntu Xenial Xerus. Select NAT for the Network selection option.



While pressing Finish button, a small dialog appears indicating a progress of creating virtual machine. 



6. Boot Ubuntu Operating System


After the fifth step, you should find Virtual Machine Manager with QEMU/KVM runs your Ubuntu as virtual OS. See the title bar "Xenial on QEMU/KVM" indicating it is a virtual machine named Xenial running in QEMU/KVM virtualization solution. You find this as Ubuntu OS running another Ubuntu OS. Xenial running Xenial. In this picture, it shows the first step of Ubuntu installation.



You may go though all steps off Ubuntu installer (Ubiquity) and don't hesitate to format the whole disk because from the virtual machine point of view, the disk is the hard disk but from the host OS point of view, it is only a file. Formatting the disk inside this virtual machine is only affecting the .qcow2 file you create before. So do installation without hesitation.

A GNU/Linux user actually can do machine virtualization without using Oracle VirtualBox, by just taking advantage of already included feature of Linux kernel, KVM. KVM (Kernel-based Virtual Machine) is a kernel module of Linux which enables a GNU/Linux operating system to run virtual machine of another operating system (just like VirtualBox). But because KVM is a part of the kernel (kernel module), it is very lightweight and fast (compared to VirtualBox and VMWare as external things). While KVM works in kernel-space, we use QEMU as the machine emulator for user-space. This QEMU KVM combination gives the users lightweight virtualization and good performance (but with no GUI). We can make it perfect with Red Hat Virtual Machine Manager as the GUI for QEMU KVM virtualization. QEMU, KVM, and Virtual Machine Manager are all free software. We introduce here how to install them in Ubuntu.