KVM

From English Wiki
Revision as of 05:19, 15 August 2022 by Kentlee7 (talk | contribs) (Created page with "Kernel-based Virtual Machine (KVM) is a virtual machine manager in Linux. It is similar to Oracle's VirtualBox, but more difficult to install and set up. However, it can be mo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Kernel-based Virtual Machine (KVM) is a virtual machine manager in Linux. It is similar to Oracle's VirtualBox, but more difficult to install and set up. However, it can be more stable and offer more functionality that VirtualBox. Here are some common commands for those who prefer to use a command line interface for virtual machine management.


Command Function
-cpu host Emulates same CPU as host machine
-smp 2 Number of dedicated CPU cores
-vga qxl
-vga virtio -display sdl/gtk, gl=on Tweak display emulation
CLT-ALT-f Full screen display
CTL-ALT-g Uncapture mouse
qemu-img convert -f raw ubuntu.img -O qcow2 ubuntu.qcow2 Convert OS image file to QEMU file
qemu-img convert -f vdi -O qcow2 ubuntu.vdi ubuntu.qcow2 Convert VDI file to QEMU file
qemu-img create -f qcow2 Image.img 100G Create a KVM image file of 100GB
qemu-system-x86_64 -enable-kvm -boot menu=on drive=Image.img -m 8G Start an installed virtual machine
qemu-system-x86_64 -enable-kvm -cdrom Manjaro.iso -boot menu=on drive=Image.img -m 8G Mount an installation file
sudo modprobe qxl bochs_drm Check kernal
VBoxManage clonehd --format RAW ubuntu.vdi ubuntu.img Convert VDI file to raw image file
VBoxManage clonehd box-disk1.vmdk ubuntu.vdi --format vdi Convert VBox VMDK file to VDI
VBoxManage convertdd ubuntu.img ubuntu.vdi Convert OS image file to VDI file
virt-viewer –connect=qemu:///session -domain-name win10 Connect in terminal to virtual machine (specifying name of session and machine)



See also