WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

What is QEMU Guide? How to Use it?

Demow

New member

0

0%

Status

Offline

Posts

41

Likes

0

Rep

0

Bits

215

3

Months of Service

0%
Hello from the guides after a long break! In this article, we will take a look at what QEMU is. Let's get started!

What is QEMU?

QEMU, or Quick EMUlator, is a free virtualization software. Virtualization software is a technology that allows you to run an operating system within another operating system. For example, let's say you are using Windows. If you 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 qemuFedoraDNF install qemuGentooemerge --ask app-emulation/qemuOpenSUSEzypper install qemuWindows, macOS

Download QEMU - QEMU

www.qemu.org

Compilation from Source Code

Bash:Copy to Clipboardgit 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 the .img extension. We can write this file to a USB disk using the dd command, but if you are doing fancy things on the virtual machine, you may damage the disk on your computer.

qcow2 is less stressful on the disk compared to RAW files. But writing to a USB disk is not as easy as RAW files. If you are going to do fancy things, this would be a better choice.

Now, let's create this virtual disk.

For RAW:
```bash
qemu-img create [name].img [size]G
```
For qcow2:
```bash
qemu-img create -f qcow2 [name].qcow2 [size]G
```

Our virtual disk is ready! Now, we can start the operating system by booting from the created disk with an ISO file. Use the following command to run:

```bash
qemu-system-x86_64 --enable-kvm -hdd [name].[extension] -cdrom [name].iso -m [RAM size]G
```

It's that simple! If you used a RAW image, you may get a warning when running. You don't need to worry about it.

Some parameters that may be useful:

- boot -d: Boot from the virtual disk.
- boot -c: Boot from the ISO file.
- -m 2G: Use 2GB of RAM.
- -cdrom [file]: Set the file as a CDROM.
- -hda [file]: Set the file as the primary virtual disk.
- -hdb [file]: Set the file as the secondary virtual disk.
- -hdc [file]: Set the file as the tertiary virtual disk.
- -hdd [file]: Set the file as the quaternary virtual disk.
- --enable-kvm: Support virtualization with KVM.
- -cpu host: Use the host machine's CPU name.
- -smp cores=2: Use 2 cores.
- -vga cirrus: Show cirrus as the graphics card.
- -vga vmware: Show vmware as the graphics card.
- -nic user,hostfwd=tcp::2222-:22: Redirect port 22 on the virtual machine to port 2222 on the host.

Useful Websites:

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 that allow the use of virtualization technology on Linux systems.

www.sysnettechsolutions.com

Take care until the next guide hopefully.
 

249

6,622

6,642

Top