Page 1 of 1

Start QEMU virtual machine from non-graphical boot?

Posted: Mon Mar 27, 2023 11:34 am
by Neo_78

FatDog gives the option to forego graphical boot with the pfix=nox boot parameter.

Once you have booted in this way, has anyone tested if you can start a FatDog virtual machine with QEMU from that non-graphical environment? Or does QEMU require the full graphical desktop?

Thanks for your feedback! :thumbup:


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Mon Mar 27, 2023 12:18 pm
by rockedge

Yes it is possible to run shell console only distro versions without any graphical server at all in both QEMU and VirtualBox.


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Mon Mar 27, 2023 1:13 pm
by step
Neo_78 wrote: Mon Mar 27, 2023 11:34 am

start a FatDog virtual machine with QEMU from that non-graphical environment? Or does QEMU require the full graphical desktop?

Do I understand you correctly, you want to run QEMU without a graphical backend, such as Xorg, Wayland, OpenGL or Vulkan? I've never tried. It appears QEMU can display the VGA output in text mode with ncurses. Read more here, https://stackoverflow.com/questions/6710555.


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Mon Mar 27, 2023 7:25 pm
by Neo_78

@step the idea is to run FatDog in headless mode on a central machine in the network with shell-only access (i.e. no desktop environment) for the different network users (each user with their own account). The users can then access this central machine (only from inside the same network), for instance via SSH or VNC, and start their preferred, custom iso via QEMU from the command line to actually start a desktop environment of their favourite OS.


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Tue Apr 04, 2023 2:08 am
by jamesbond

There are four options. All these four options enable you to run qemu on pure text console.

1) qemu-system-x86_64 -display vnc=127.0.0.1:0 will start qemu in headless mode.
You can later view the output by using a VNC viewer.

2) qemu-system-x86_64 -display curses will start qemu in curses mode. Only text output is visible.

3) If you completely don't want to ever see the display, then use -display none.

With (1), (2), and (3) the guest OS can still run in graphical mode (qemu still emulates a graphic card), except that on the option (2) you can only see things when the guest OS is display text, and (3) you can't see that the guest OS is displaying at all.

4) If you don't want to have a graphics card at all, then use qemu-system-x86_64 -nographic instead. This boots qemu with the emulated serial console connected, your guest OS should be better be prepared to live without a graphic card and talk over the serial console, otherwise, you will see absolutely nothing and the system may not even be able to boot.

All the options allow you to start qemu in linux virtual console. But beware, one is not like the other. Fatdog as a guess OS support (1), (2), and (3) but not (4). (Not that it cannot be modified; it can, easy actually, but it does not support serial console by default, because ... well, who uses serial console by default on a PC?)


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Tue Apr 04, 2023 8:26 pm
by Neo_78

Thanks @jamesbond. Do we have a guide how to access a qemu vm in your local network started via option 1 in FatDog?


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Tue Apr 04, 2023 8:29 pm
by rockedge

I think TigerVNC viewer/client will work.


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Wed Apr 05, 2023 12:41 pm
by jamesbond

The previous post (1) assumes you want to access it on the same machine that it runs on. If you want to run on another machine and access it over the network, the command you want to use is qemu-system-x86_64 -display vnc=:0

That will run qemu in VNC display :0, and you can access it using any VNC viewer, as rockedge said above. One example is like this: vncviewer ip-address:0 while "ip-address" is the IP address of the qemu that runs qemu. If you want to run more than one qemu on the same machine, you can increase the display number, like :1, :2, :3 and use the same number on the vncviewer.

There you go. You're on the way building your VPS server business already :lol: :thumbup:
Buy an AWS server instance, run 100 qemus there, and re-sell it to others. Because why not :lol:


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Wed Apr 05, 2023 9:04 pm
by Neo_78

Thanks @jamesbond. My current use case is just to run a headless FatDog server in my local network for multiple users to quickly fire up their favourite OS as a virtual QEMU desktop.

You took that idea to another level... :lol: :thumbup:
There actually is a niche market for standardized cloud desktop work environments that companies can use for their staff on a remote basis.

Have you ever tried to run FatDog as a web server?

Anyway... in my local network I guess the easiest approach would be to create separate user accounts on the headless FatDog server so that each user can VNC into that central server from their machine in the same network and then log into their user account on the server. Once that VNC connection has been started, the user can then fire up their preferred desktop as a QEMU VM. So in this case the visual QEMU desktop is started in the same VNC session, right?

Also, is it possible to start a QEMU VM from a bash script to take away the complexity of the configuration options?

In that way I could build a user menu on the FatDog server to display the available OS versions.


Re: Start QEMU virtual machine from non-graphical boot?

Posted: Wed Apr 12, 2023 4:53 pm
by jamesbond
Neo_78 wrote: Wed Apr 05, 2023 9:04 pm

Have you ever tried to run FatDog as a web server?

Hahaha. Not telling you. Have you?

Anyway... in my local network I guess the easiest approach would be to create separate user accounts on the headless FatDog server so that each user can VNC into that central server from their machine in the same network and then log into their user account on the server. Once that VNC connection has been started, the user can then fire up their preferred desktop as a QEMU VM. So in this case the visual QEMU desktop is started in the same VNC session, right?

Correct, but you have two choices here. Either you run qemu headless and connect from (yet another) VNC viewer, or you can have qemu running with display connected to the currently running VNC session.

Also, is it possible to start a QEMU VM from a bash script to take away the complexity of the configuration options?

Yes, of course. Why not. Look for qemu-vm-manager.sh as an example, but that's complicated because it's trying to generic. If you want to hardcode the options, then it shouldn't be too difficult at all.