Getting a shell to a headless VM

I’m still debugging my sys-gui-gpu VM, and I’d like to interact with it a bit while it’s running, while it still has not managed to start the amdgpu driver. /var/log/xen/console/guest-sys-gui-gpu.log shows that despite the driver woes the VM is still running, showing a getty prompt and kernel console traces.

If I try to open a plain old shell with qvm-run -p sys-gui-gpu 'bash -i', I just don’t get any output (my ^C gets highlighted in red as the shell output should, but I just don’t get to interact with any process in the VM).

xl console, for its part, refuses with Unable to attach console (maybe because the console is already redirected to a file?)

… and I don’t get any clue in the various logfiles.

Any idea ?

Try using qvm-console-dispvm from dom0.

Or try adding --no-gui to your qvm-run command.

3 Likes

This command does not include a man page or a --help output, but launching it without arguments displays the help:

$ qvm-console-dispvm 
Usage: /usr/bin/qvm-console-dispvm [--autostart] [--] vmname
Connects to VM console throught DispVM using the qubes.ShowInTerminal RPC service.
With --autostart, start the VM first.

Source code : qvm-console-dispvm.

qvm-console-dispvm can’t seem to work, failing with HVM with kernel with empty `kernel` pref fails to start "exceeding maximum recursion level" · Issue #7061 · QubesOS/qubes-issues · GitHub – I really need to dig more into that one.

qvm-run --no-gui does the trick, thanks!

Now it appears the usability of that user shell is a bit limited. With --passio not providing a tty to the VM shell, I can launch individual root commands with sudo, but cannot get an interactive root shell, and I don’t have any shell history – sad thing having to cut/paste/edit :sob: – but at least I do have that shell :slight_smile: