3

I need to install a KVM guest OS but without the use of a GUI. What I found so far:

create a disk image for the guest

qemu-img create -f qcow2 vdisk.img 10G

install the guest OS

qemu-system-x86_64 -hda vdisk.img -cdrom /path/to/boot-media.iso \ 
   -boot d  -m 1024 -localtime -clock unix -nographic

Adding in the nographic paramater will disable the video output and I'll see nothing; I would have expected some output to be redirected to the console, but I get nothing.

I tried replacing -nographic with -curses but that did not help either.

So the question stands: can you install an guess OS in kvm without a GUI?

2 Answers 2

1

eventually I figured it out; It can be done using a vnc connection. Use the following options:

-nographic -vnc your_server_ip:1 -k en-us

This will start a vnc server to which you can connect from another machine using a vnc client.

0

sudo mount -o loop image.iso tmp/ This step will mount the disk image to a tmp directory. copy the vmlinuz and initrd inside tmp to a directory. You may use the find command to search the paths of files. The file location depends on the distribution. For example, for ubuntu 19.10 the path are tmp/casper/initrd and tmp/casper/vmlinuz. add -nographic -append console=ttyS0 \ -kernel path/to/vmlinuz \ -initrd path/to/initrd to the qemu command, and then you can install the vm with command text only.

Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .