Hello from guides after a long break! In this article, we will take a look at what QEMU is all about. Let's get started!
What is QEMU?
QEMU, which stands for Quick EMUlator, is a free virtualization software. Virtualization software is a technology that allows running an operating system inside another operating system. For example, if you are using Windows and want to try GNU/Linux without installing it on your computer, virtualization software comes to your rescue.
Installation
Operating SystemCommandUbuntu, Debianapt install qemuArch Linuxpacman -S qemuFedora dnf install qemuGentoo emerge --ask app-emulation/qemuOpenSUSEzypper install qemuWindows, macOS
Download QEMU - QEMU
www.qemu.org
Compiling from Source Code
Bash:Copy to clipboard
git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure
make
sudo make install
Usage
First, we need to determine the type of our virtual disk.
RAW images are files with a .img extension. You can write this file to a USB disk using the dd command, but if you are doing fancy things on the virtual machine, you might damage the disk on your computer.
qcow2 is less wearing on the disk compared to RAW files. However, writing to a USB disk is not as easy as with RAW files. If you plan to do fancy things, this might be a better choice.
Next, let's create this virtual disk.
[CODE lang="bash" title="For RAW"]qemu-img create [name].img [size]G[/CODE]
[CODE lang="bash" title="qcow2"]qemu-img create -f qcow2 [name].qcow2 [size]G[/CODE]
Our virtual disk is ready! Now, we can boot from the created disk with an ISO file and install the operating system. Let's run the following command:
Bash:Copy to clipboard
qemu-system-x86_64 --enable-kvm -hdd [name].[extension] -cdrom [name].iso -m [ram size]G
That's it! If you're using a RAW image, you might get a warning when running. You don't need to worry about this.
Some parameters that may be useful for you:
boot -dBoots from the virtual disk.boot -cBoots from the ISO file.-m 2GUses 2GB of RAM.-cdrom [file]Sets the file as the CDROM.-hda [file]Sets the file as the primary virtual disk.-hdb [file]Sets the file as the secondary virtual disk.-hdc [file]Sets the file as the third virtual disk.-hdd [file]Sets the file as the fourth virtual disk.--enable-kvmSupports virtualization with KVM.-cpu hostUses the CPU name of the local machine.smp cores=2Uses 2 cores.-vga cirrusShows cirrus as the graphics card.-vga vmwareShows vmware as the graphics card.-nic user,hostfwd=tcp::2222-:22Redirects port 22 on the virtual machine to port 2222 on the host.
Sources I used:
Qemu-KVM Usage
QEMU
www.qemu.org
What are KVM and QEMU? How to Install? | SYSNETTECH Solutions
In this article, we will examine how to install KVM and QEMU, which allow the use of virtualization technology on Linux systems.
www.sysnettechsolutions.com
Take care of yourself until the next guide hopefully.
What is QEMU?
QEMU, which stands for Quick EMUlator, is a free virtualization software. Virtualization software is a technology that allows running an operating system inside another operating system. For example, if you are using Windows and want to try GNU/Linux without installing it on your computer, virtualization software comes to your rescue.
Installation
Operating SystemCommandUbuntu, Debianapt install qemuArch Linuxpacman -S qemuFedora dnf install qemuGentoo emerge --ask app-emulation/qemuOpenSUSEzypper install qemuWindows, macOS
Download QEMU - QEMU
www.qemu.org
Compiling from Source Code
Bash:Copy to clipboard
git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure
make
sudo make install
Usage
First, we need to determine the type of our virtual disk.
RAW images are files with a .img extension. You can write this file to a USB disk using the dd command, but if you are doing fancy things on the virtual machine, you might damage the disk on your computer.
qcow2 is less wearing on the disk compared to RAW files. However, writing to a USB disk is not as easy as with RAW files. If you plan to do fancy things, this might be a better choice.
Next, let's create this virtual disk.
[CODE lang="bash" title="For RAW"]qemu-img create [name].img [size]G[/CODE]
[CODE lang="bash" title="qcow2"]qemu-img create -f qcow2 [name].qcow2 [size]G[/CODE]
Our virtual disk is ready! Now, we can boot from the created disk with an ISO file and install the operating system. Let's run the following command:
Bash:Copy to clipboard
qemu-system-x86_64 --enable-kvm -hdd [name].[extension] -cdrom [name].iso -m [ram size]G
That's it! If you're using a RAW image, you might get a warning when running. You don't need to worry about this.
Some parameters that may be useful for you:
boot -dBoots from the virtual disk.boot -cBoots from the ISO file.-m 2GUses 2GB of RAM.-cdrom [file]Sets the file as the CDROM.-hda [file]Sets the file as the primary virtual disk.-hdb [file]Sets the file as the secondary virtual disk.-hdc [file]Sets the file as the third virtual disk.-hdd [file]Sets the file as the fourth virtual disk.--enable-kvmSupports virtualization with KVM.-cpu hostUses the CPU name of the local machine.smp cores=2Uses 2 cores.-vga cirrusShows cirrus as the graphics card.-vga vmwareShows vmware as the graphics card.-nic user,hostfwd=tcp::2222-:22Redirects port 22 on the virtual machine to port 2222 on the host.
Sources I used:
Qemu-KVM Usage
QEMU
www.qemu.org
What are KVM and QEMU? How to Install? | SYSNETTECH Solutions
In this article, we will examine how to install KVM and QEMU, which allow the use of virtualization technology on Linux systems.
www.sysnettechsolutions.com
Take care of yourself until the next guide hopefully.