Hello from the 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, short for Quick EMUlator, is a free virtualization software. Virtualization software allows you to run an operating system within another operating system. For example, let's say you are using Windows. You want to try GNU/Linux without installing it on your computer. In such a case, virtualization software comes to your aid.
Installation
Operating System Command Ubuntu, Debian apt install qemu Arch Linux pacman -S qemu Fedora dnf install qemu Gentoo emerge --ask app-emulation/qemu OpenSUSE zypper install qemu Windows, macOS
Download QEMU - QEMU
www.qemu.org
Compilation 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 some fantastic tasks on the virtual machine, you may damage the disk on the computer.
- qcow2 is less fatiguing for the disk compared to RAW files. However, writing to a USB disk is not as easy as with RAW files. If you are planning to do fancy things, this would be a better choice.
Now, let's create this virtual disk.
For RAW:
qemu-img create [name].img [size]G
For qcow2:
qemu-img create -f qcow2 [name].qcow2 [size]G
Our virtual disk is ready! Now we can start an operating system by booting from the ISO file. Let's run this 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 used a RAW image, you may receive a warning when starting up. You can ignore this warning.
Some useful parameters for your work:
- boot -d: Boots from the virtual disk.
- boot -c: Boots from the ISO file.
- -m 2G: Uses 2GB of RAM.
- -cdrom [file]: Sets the file as a 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-kvm: Supports virtualization with KVM.
- -cpu host: Uses the host machine's CPU name.
- smp cores=2: Uses 2 cores.
- -vga cirrus: Sets cirrus as the graphics card.
- -vga vmware: Sets vmware as the graphics card.
- -nic user,hostfwd=tcp::2222-:22: Redirects port 22 on the virtual machine to port 2222 on the host.
Sources:
Qemu-KVM Usage
QEMU
www.qemu.org
What are KVM and QEMU? How to Install? | SYSNETTECH Solutions
In this article, we will explore 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!
What is QEMU?
QEMU, short for Quick EMUlator, is a free virtualization software. Virtualization software allows you to run an operating system within another operating system. For example, let's say you are using Windows. You want to try GNU/Linux without installing it on your computer. In such a case, virtualization software comes to your aid.
Installation
Operating System Command Ubuntu, Debian apt install qemu Arch Linux pacman -S qemu Fedora dnf install qemu Gentoo emerge --ask app-emulation/qemu OpenSUSE zypper install qemu Windows, macOS
Download QEMU - QEMU
www.qemu.org
Compilation 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 some fantastic tasks on the virtual machine, you may damage the disk on the computer.
- qcow2 is less fatiguing for the disk compared to RAW files. However, writing to a USB disk is not as easy as with RAW files. If you are planning to do fancy things, this would be a better choice.
Now, let's create this virtual disk.
For RAW:
qemu-img create [name].img [size]G
For qcow2:
qemu-img create -f qcow2 [name].qcow2 [size]G
Our virtual disk is ready! Now we can start an operating system by booting from the ISO file. Let's run this 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 used a RAW image, you may receive a warning when starting up. You can ignore this warning.
Some useful parameters for your work:
- boot -d: Boots from the virtual disk.
- boot -c: Boots from the ISO file.
- -m 2G: Uses 2GB of RAM.
- -cdrom [file]: Sets the file as a 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-kvm: Supports virtualization with KVM.
- -cpu host: Uses the host machine's CPU name.
- smp cores=2: Uses 2 cores.
- -vga cirrus: Sets cirrus as the graphics card.
- -vga vmware: Sets vmware as the graphics card.
- -nic user,hostfwd=tcp::2222-:22: Redirects port 22 on the virtual machine to port 2222 on the host.
Sources:
Qemu-KVM Usage
QEMU
www.qemu.org
What are KVM and QEMU? How to Install? | SYSNETTECH Solutions
In this article, we will explore 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!