Install Linux OS With Qemu CLI
Contents
Background
Sometimes you want to build a reproducer for some installation issues. Instead of putting the actual CD-ROM in your machine, QEMU, a popular hardware virtualization solution, could help you to test it on virtual machines. Qemu can help you to do a GUI install with Desktop or live Server install ISO, or use text-mode installation with a Server install CD.
Install
|
|
And also you need a ISO for installation.
simplefied case
|
|
But above command should not work and will be a kernel panic. Be default qemu will only allocates 128MB of memory by default which is not enough in most case. And ther is no hard drive attached to the VM for the instalation to complete.
With a specified hard drive and a proper memory
|
|
But only use QEMU to run a instance will be very slow. You need to add
-enable-kvm
option to let QEMU to run in KVM mode. To use this option you
need to make sure KVM is supported by your processor and kernel.
So, try below command and you can have a GUI to install the OS.
|
|
Other scenarios
With more than one disks
|
|
With a boot menu
|
|
With physical USB drive (requires root, hdb is used to avoid conflict)
|
|
With an image as USB drive
|
|
refers
http://manpages.ubuntu.com/manpages/bionic/man1/qemu-system.1.html
Author Wenhan Shi
LastMod 2023-01-27 (c5aae83)