../.

../.

.

How to install Latest Qemu Emulator/Virtualizer on Linux distributions.

Today we show you how to install the latest Qemu Version to run a Windows VM Or any other Virtual machine with any OS. In this tutorial we Describe everything we are going to do in steps.

(This tutorial has been made with an Linux Debian Buster Distribution, And Windows ISO Named

“SW_DVD9_Win_Server_STD_CORE_2019_64Bit_English_DC_STD_MLF_X21-96581.ISO”)

What you need for this tutorial:

  • An windows ISO or any other OS Image of your liking.
  • An Linux Based system.
  • An Empty Drive Partition to install VM to.
  • A SSH Client Like Putty.
  • A VNC Client Like RealVNC.

 

Step 1. Fully update and upgrade your Linux distro with the Commands “Sudo apt-get update” “Sudo apt-get full-upgrade”.

Now that your system is up to date we can go on.

Step 2. We are going to install some packages needed to install the latest Qemu.

“sudo apt install gcc bzip2 pkg-config glib2.0 libpixman-1-dev make cmake p7zip binutils binfmt-support”

“sudo apt install --no-install-suggests unar”

“sudo apt install binfmt-support qemu qemu-user-static unzip qemu-kvm bridge-utils virtinst ovmf qemu-utils virt-manager”

Now that we have all those packages installed we can go onto the next steps. You may have noticed that the Qemu we have installed is not the latest version available. You can see what version you have installed with the command “apt show qemu-system-x86”.

Next we are Going to install GRUB and and will run some commands to improve host performance for later on when running an virtual machine.

Step 3. Install Grub with the command “sudo apt install grub”.

Once installed we are going to enable IOMMU for better passthrough host performance. Together with that we are setting an different hugepages size. Which also improves performance. In step 4 Replace The word “CPU” with your brand of cpu (amd/intel) to configure those settings correctly for your server.

Step 4.  Run the command

“GRUB_CMDLINE_LINUX_DEFAULT="quiet splash CPU_iommu=on CPU_iommu=pt hugepages=8192" Once ran you run the command “update-grub” and then reboot your server with the command “reboot”

Once your server has rebooted we are installing the latest Qemu version (5.1.0 when this tutorial was made)

Step 5. Download the latest Qemu version with the command

“wget https://download.qemu.org/qemu-5.1.0.tar.xz” Once downloaded we need to extract the downloaded file. We do that with a package we installed earlier. “unar qemu-5.1.0.tar.xz”

When the file is extracted, navigate to the folder with the command “cd qemu-5.1.0”

Then run the command “./configure” and then “make install”

Running those commands will configure the install and then install the latest Qemu version, Installing this can take a bit of time depending on the specifications of your server/system.

After the installation is done you have installed the latest Qemu Emulator/Virtualizer version.

Before Running a virtual machine make sure you have a separate drive partition made where your VM can be installed. I am not going to show you how to do that in this tutorial.

Step 6. First we are going to install a package named screen so that Our Virtual machine doesn’t shutdown when we close our SSH connection. Install screen with the command “apt install screen”

With Step 7 We are going to configure our launch options for Qemu.

Our launch options are;

“screen qemu-system-x86_64 \

-net nic -net user,hostfwd=tcp::3389-:3389 -m 10000M \

-enable-kvm -cpu host -smp sockets=1,cores=16,threads=2 -k en-us \

-cdrom /tmp/ SW_DVD9_Win_Server_STD_CORE_2019_64Bit_English_DC_STD_MLF_X21-96581.ISO \

-hda /dev/sdb -vnc :1 -boot d”

Now to configure it you change the following things to your liked specifications

-m 10000M, You change the 10000 To the Amount of RAM you want to use in MB’s


-cpu host, You Change host to the type of CPU you are using. However it is recommended to use host as this will replicate exactly the CPU you are using.


-smp sockets=1,cores=16,threads=2, Change The amount of cpu’s you have installed in sockets. How much cores one of those CPU’s has and how much threads per Core. So socket=1 Means 1 CPU installed, Cores=16 Means the CPU has 16 Cores and threads=2 means the CPU has 2 threads per core for a total of 32 Threads (32vCore CPU)


-cdrom /tmp/SW_DVD9_Win_Server_STD_CORE_2019_64Bit_English_DC_STD_MLF_X21-96581.ISO, Here you set the location of your ISO/Installation image. In this example it is located in the tmp folder and my ISO is named “SW_DVD9_Win_Server_STD_CORE_2019_64Bit_English_DC_STD_MLF_X21-96581”


-hda /dev/sdb, Here you set the location of your empty drive partition. In this example my empty drive partition is /dev/sdb.

-vnc :1, You specify with this on which port you connect to with your VNC Client to finish the installation of your Virtual machine.

Now that you have customized the launch options of your Virtual Machine to your likings you are ready to launch it. All you have to do is run the launch options in your SSH client.

 


Report Page