oasislinux / oasis

a small statically-linked linux system
Other
2.75k stars 84 forks source link

[BUG] QEMU VM Does Not Show Up Wth Virsh When Running `virsh --connect qemu:///system list --all` | Cannot Connect With Virt-Viewer #88

Closed VehementHam closed 5 months ago

VehementHam commented 5 months ago

There are no provided instructions on how to view the GUI of the VM of the QEMU image.

michaelforney commented 5 months ago

Perhaps you missed README.md? It's provided in oasis-qemu.tar.gz, and is also available inside the image at ~/README.md. The instructions are in the "Display server" section:

Display server

In graphics mode, you can launch velox with

swc-launch velox

velox works similarly to dwm, and has similar default keybindings:

  • Launch a terminal: Alt-Shift-Enter
  • Launch a browser: Alt-b
  • Launch dmenu: Alt-r
  • Cycle window focus: Alt-[jk]
  • Move window to/from master area: Alt-Enter
  • Change workspace Alt-[1-9]
VehementHam commented 5 months ago

Right, but when launch the VM in GUI mode, there is no GUI. All there is is the QEMU monitor.

VehementHam commented 5 months ago

I started the VM with the run script. After starting it. the VM does not show up when I run virsh --connect qemu:///system list --all. Also, virt-viewer does not detect the VM. There are no instructions on how to actually view the VM provided in the tarball ro the README.

michaelforney commented 5 months ago

I don't know anything about virsh or virt-viewer, but perhaps your qemu has some other default display? Try ./run -- -display sdl or ./run -- -display gtk.

abbbi commented 5 months ago

I started the VM with the run script. After starting it. the VM does not show up when I run virsh --connect qemu:///system list --all. Also, virt-viewer does not detect the VM. There are no instructions on how to actually view the VM provided in the tarball ro the README.

starting a qemu process that is not related to libvirt wont show up in virsh. libvirt is an layer on top of qemu, to manage virtual machines. oasis comes with a script that starts a single qemu process, no libvirt is involved here. virt-viewer or any other virt-* tools wont work with it.

You have to check if your installed qemu version was actually compiled with graphics support

michaelforney commented 5 months ago

After looking around a little, my guess is that it is using -display dbus by default. I'm not sure how that's supposed to work, googling didn't help much. I think using some other qemu display should work.

Alternatively, if you are set on using virt-manager, you should be able to just add a new VM with the qcow2 image, and set it to boot the bzImage kernel directly. Set the kernel arguments to init=/bin/sinit root=/dev/vda ro, and make sure to enable various virtio drivers (virtio-keyboard, virtio-tablet, virtio-vga).

VehementHam commented 5 months ago

After looking around a little, my guess is that it is using -display dbus by default. I'm not sure how that's supposed to work, googling didn't help much. I think using some other qemu display should work.

Alternatively, if you are set on using virt-manager, you should be able to just add a new VM with the qcow2 image, and set it to boot the bzImage kernel directly. Set the kernel arguments to init=/bin/sinit root=/dev/vda ro, and make sure to enable various virtio drivers (virtio-keyboard, virtio-tablet, virtio-vga).

Thanks. I think I just compiled QEMU without the gtk USE flag.

VehementHam commented 5 months ago

Yeah