DS Log
In my blog, I delve into the world of programming web technologies, Linux, Unix-like, and graphic design using free tools on Linux.
KINGCODE
KingCode Editor (ex Texty Editor) is my project developed using Java Swing. Project is still in development and in beta version. I plan to add additional features focused for PYTHON, PHP, JAVA, C, JS and BASH.
Read more ↗
VUE on Linux
In this guide, I'll walk you through the step-by-step process of setting up Vue.js on your Linux system, empowering you to create dynamic and interactive web applications. Let's harness the power of Vue.js together on the Linux platform!
Read more ↗
Symfony PHP
Dive into the world of Symfony PHP with this comprehensive introduction. In this guide, you'll learn the essential steps to create and manage posts and users, empowering you to build dynamic web applications with ease.
Read more ↗
Trying Linux from Windows
How to set up a PHP development server on Ubuntu 22.04
Text editors
List of text editors for developers.
Read more ↗
Fonts
Important fonts everyone needs to know.
Read more ↗
Try Linux from Windows
Here are some quick videos I made showing how to try out Linux Mint on Windows.
Read more ↗
Wednesday, July 31, 2024
QEMU – quick emulator
QEMU (Quick Emulator) is an open source virtualization tool that allows you to run operating systems and programs designed for one machine architecture on another. It provides hardware emulation for various computer systems, including x86, ARM, PowerPC and others. QEMU can be used as a full-system emulator, which means it emulates the entire hardware environment of the target system, or as a user-space emulator, which allows running individual applications compiled for a different architecture. In short something like Virtualbox only without the things we don't like about Oracle.
Key features
Key Feature | Description |
Hardware Virtualization | QEMU supports hardware virtualization using KVM (Kernel-based Virtual Machine) on Linux and Hyper-V on Windows, allowing for efficient and high-performance virtual machine execution. |
Cross-Platform Compatibility | QEMU can emulate a wide range of hardware architectures, including x86, ARM, MIPS, PowerPC, and more, making it a versatile tool for cross-platform development and testing. |
Emulation of Peripherals | QEMU can emulate a variety of hardware peripherals, such as network cards, storage devices, and input devices, allowing for the creation of complex virtual environments. |
Live Migration | QEMU supports live migration, which allows you to move a running virtual machine from one host to another with minimal downtime, making it useful for load balancing and high availability scenarios. |
Snapshot and Rollback | QEMU provides the ability to take snapshots of virtual machines, which can be used to restore the system to a previous state, making it useful for testing and debugging purposes. |
Networking Support | QEMU supports various networking modes, including user-mode networking, tap networking, and bridge networking, allowing for the creation of complex virtual network topologies. |
Storage Management | QEMU supports a wide range of storage formats, including raw disk images, QCOW2, and VHD, and provides tools for managing and manipulating these images. |
Quick installation
Here are the terminal commands with which we can install everything without reading the explanation:
sudo apt update && upgrade
sudo apt-get install build-essential git python3-venv flex bison libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
sudo apt install qemu-kvm
sudo apt install virt-manager
sudo apt install libvirt-daemon
sudo systemctl enable libvirtd
sudo systemctl start libvirtd
cd ~/Downloads/
git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure
make
sudo make install
Installation with explanations
First of all, we need to update the system:
sudo apt update && upgrade
The "build-essential" package in Ubuntu is a metapackage that includes a set of essential tools and libraries needed to compile software from source code. When you install the “build-essential” package, it installs several packages that are typically required during software development. We need this to compile…
sudo apt-get install build-essential git python3-venv flex bison libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
When used together, QEMU and KVM form a powerful combination known as QEMU-KVM or simply KVM. QEMU provides an emulation and virtualization framework, while KVM uses hardware virtualization extensions (such as Intel VT-x or AMD-V) to improve performance and efficiency.
With QEMU-KVM, you can create and manage virtual machines running guest operating systems, such as Linux, Windows, or other supported operating systems. Virtual machines have access to virtualized hardware resources, including CPU cores, memory, storage devices, and network interfaces.
sudo apt install qemu-kvm
Virt-manager is a graphical user interface (GUI) application for managing virtual machines (VMs) and virtualization hosts. It is built on the libvirt API, which is a library for interacting with various virtualization technologies, including QEMU-KVM, Xen, LXC, and others.
sudo apt install virt-manager
libvirt-daemon, or simply libvirtd, is a component of the libvirt library and tools. It acts as a back-end service that manages virtualization capabilities and provides an API to interact with various virtualization technologies, such as QEMU-KVM, Xen, LXC, and others. libvirt-daemon provides a common interface and abstraction layer for managing virtual machines and hypervisors. It allows applications and tools to control and monitor virtualization hosts, perform virtual machine management tasks, and access virtualization resources.
sudo apt install libvirt-daemon
Let's provide services:
sudo systemctl enable libvirtd
sudo systemctl start libvirtd
Then we will compile the components that cannot be distributed in "binary" form:
cd ~/Downloads/
git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure
make
sudo make install
Testing with Alpine Linux
Alpine Linux is a lightweight Linux distribution focused on security and highly efficient. It is designed with simplicity, resource efficiency and security in mind, making it particularly suitable for embedded systems, container environments and thin servers.
First, we will look for the ISO file, then enter in the search engine:
alpine linux download
Then we download the EXTENDED x86_64 ISO version.
After that, we have to create a virtual disk, and we do that with the command:
qemu-img create -f qcow2 alpine.qcow2 8G
And the command with which we start our virtual computer is:
qemu-system-x86_64 -m 512 -boot d -cdrom ./alpine-extended-3.18.2-x86_64.iso -hda alpine.qcow2 -display sdl -enable-kvm