You are not logged in.

#1 2022-05-10 02:40:04

TarsolyGer
Member
From: Korea
Registered: 2019-05-19
Posts: 73

startx fails in a VM with quemu (Arch Linux host, Arch Linux guest)

TLDR: I have an Arch Linux VM that I used to experiment with different apps. I last used it in December, and it worked as expected. Now, when I try to start XOrg running "startx", the screen goes black and nothing happens for minutes.

What I have done previously that used to work:
I have installed Arch Linux in using QEMU as my emulator / hypervisor last year, and installed dwm and xorg on it, and then proceeded to play around with theming, etc.

This is the command I start the VM up with:

qemu-system-x86_64 -m 4G -hda disk_img.qcow \
	-hdb disk_img2.qcow \
	-bios /usr/share/ovmf/x64/OVMF_CODE.fd \
	-enable-kvm

I have installed the graphical environment (circa August last year) with the following command:

sudo pacman -S xf86-video-vmware xorg-server xorg-xinit xorg-xsetroot git base-devel

Then I installed ST and DWM from the AUR using the recommended method with `makepkg -si`.
Then I did

cp /etc/X11/xinit/xinitrc ~/.xinitrc

and edited .xinitrc so that the last 5 lines were deleted from the default, then added

setxkbmap hu
exec dwm

Using this method, running `startx` launched the window manager, and things worked as expected. Last time I used this VM was in December.

What happened recently:
Last week, on Wednesday or Thursday, I booted back to this VM (the host machine was regularly updated), and tried to run X, which didn't work, the screen went dark. I decided to do a `sudo pacman -Syu` on the host, then also on the guest, but that did not solve the issue.
I have also waited for the new qemu update (I saw the discussion in the arch dev public mailing list), and updated my system, which replaced the old `qemu` package with the new `qemu-desktop` and its dependencies, but still have not solved the issue.

The things I have tried:
I had an other VM with a very bare bones Arch install from a few weeks back when I was experimenting with other things, which did not have any graphical things installed, and installed Xorg and ST and DWM the same way I did on the previous machine, and, it also did not work.

I have tried to run qemu with explicitly the vmware video emulator by using the `-vga vmware` switch at the end, but that ends up the VM freezes apparently before reaching the log in prompt. However, if I remove the -vga switch and reboot the system, and check the journal on the last boot, `journalctl -b -1` tells me that it has "reached target Graphical Interface", and "Startup finished in 584542y 2w 2d [...]", which is where the journal stops.

To check whether it is a qemu issue, I downloaded a Fedora live image which boots directly to the graphical interface, and booted that up in qemu both with and without the `-vga vmware` flag. Both case, the graphical environment booted up properly, but things in general worked better without the vga flag.

Things I don't know:
My first guess was that there must have been some breaking change in the way qemu emulates the graphical output, but have not found anything on this topic, so I don't know what other driver / other package should I have installed in the VM that was not required before, but is required now? I understand that the Fedora live image probably has all possible drivers as it should work everywhere, while on Arch I only specifically installed the vmware driver.

Any suggestion is appreciated.

Thanks a lot!


The only way... is all the way!

Offline

#2 2022-05-10 06:48:38

seth
Member
Registered: 2012-09-03
Posts: 50,957

Re: startx fails in a VM with quemu (Arch Linux host, Arch Linux guest)

xf86-video-vmware is > 6 months old and possibly not fully compatible w/ the recent xorg server versions.
Did you try the std or qxl graphics (and the modesetting driver)?

Offline

#3 2022-05-10 14:08:16

TarsolyGer
Member
From: Korea
Registered: 2019-05-19
Posts: 73

Re: startx fails in a VM with quemu (Arch Linux host, Arch Linux guest)

Thank you for the quick reply.

I tried the std graphics, but it also doesn't work. Is there any difference if I simply omit the `-vga` option or if I use `-vga std`? Both go to dark screen and become unresponsive. Do I need any additional drivers for this to work?
Here is the xorg log after trying to start x with the std graphics: https://pastebin.com/6pykkbG1


I tried starting the VM with `-vga qxl` option, and installed the xf86-video-qxl driver on the guest. I have also added qxl to the MODULES array in /etc/mkinitcpio.conf for early KMS start.
NB, when I start qemu iin the terminal, I get

qxl_send_events: spice-server bug: guest stopped, ignoring

in the terminal, but the VM starts.
However, when I attempt to start X with startx, now I don't go to a blank screen, but get an actual error:

(EE) Screen(s) found, but none have a usable configuration.

The full xorg log: https://pastebin.com/g305NZid

Thank you again.


The only way... is all the way!

Offline

#4 2022-05-10 14:51:32

seth
Member
Registered: 2012-09-03
Posts: 50,957

Re: startx fails in a VM with quemu (Arch Linux host, Arch Linux guest)

qemu defaults to std, but you suggested to be using vmware.
The std X11 server runs w/o any errors for 16 seconds.
Does the fedora image start an X11 server or wayland?

Offline

#5 2022-05-11 03:02:51

TarsolyGer
Member
From: Korea
Registered: 2019-05-19
Posts: 73

Re: startx fails in a VM with quemu (Arch Linux host, Arch Linux guest)

seth wrote:

qemu defaults to std, but you suggested to be using vmware.
The std X11 server runs w/o any errors for 16 seconds.
Does the fedora image start an X11 server or wayland?

Oh, yes sorry for the confusion.
To clarify, originally, I used std. Then when I started having problems, I also tried vmware. But even when running with std, I had the vmware driver installed, for some reason I assumed that is needed with the std itnerface, too, but I can't really see why I thought that back then. Anyways, I tried a fresh install, installing xorg and dwm without the vmware driver, but the issue (black virtual screen) still persists.

On Fedora, I checked, indeed it uses wayland. So, I grabbed a Linux Mint installation medium, and if I boot that with the std, that loads properly and the graphical environment is visible and works. I checked, and the session is X11 session in the Cinnamon DE.

Out of curiosity, I have installed cinnamon on the VM, and it actually loads properly. Well, it gives a warning on the lack of hardware acceleration, which, I think, is expected, as I have installed no drivers.

Now it seems like I might have been misdiagnosing it as an xorg issue, and it will turn out to be a dwm issue. I need to get to work, but I'll do some more digging when I get back.

Any suggestions are appreciated.

Thank you for the help so far!


The only way... is all the way!

Offline

#6 2022-05-11 06:18:05

seth
Member
Registered: 2012-09-03
Posts: 50,957

Re: startx fails in a VM with quemu (Arch Linux host, Arch Linux guest)

Look into the xsession errors, the system journal and post your xinitrc.
Also make sure that you rebuilt dwm after recent updates…

Offline

#7 2022-05-12 02:42:14

TarsolyGer
Member
From: Korea
Registered: 2019-05-19
Posts: 73

Re: startx fails in a VM with quemu (Arch Linux host, Arch Linux guest)

seth wrote:

Look into the xsession errors, the system journal and post your xinitrc.
Also make sure that you rebuilt dwm after recent updates…

I've updated the host and the guest (both my "original" VM, and the one with the fresh install) yesterday evening, and rebuilt dwm with the `makepkg -sif --clean` command.

On the "fresh" VM, dwm successfully started, but after exiting the window manager with the default alt+shift+Q combination, I don't return to the TTY, but get the empty screen. Inside dwm, things work fine. As that installation also had the cinnamon desktop installed from my last testing, I ran cinnamon too (both with `startx 2> .xsession-errors` , by switching between `exec dwm` and `exec cinnamon-session` as the last line of .xinitrc). The same thing happened as in dwm: the DE worked fine, but when exiting the session, I didn't get dropped back to the TTY, but got the blank screen.

On my "original" VM, dwm failed first, but by commenting out the xrandr line in the .xinitrc, I managed to run it. When terminating the dwm session, this VM also exits to the empty screen.

In all cases, after the empty screen, I stopped the VM by the Machine -> Power Down command in the qemu GUI.

The journal seems to have no record between the line shutdown of X and the pressing of the virtual power button (see Line 904 and 905 of the journal). According to the Xorg.0.log, the X server shuts down no problem.

my .xinitrc is there: https://pastebin.com/tEsecXRk

So, in general, I guess my original issue is solved, but a new one arose as now I can't get back to the TTY after terminating the X session.


The only way... is all the way!

Offline

#8 2022-05-17 14:29:55

TarsolyGer
Member
From: Korea
Registered: 2019-05-19
Posts: 73

Re: startx fails in a VM with quemu (Arch Linux host, Arch Linux guest)

Quick update on the issue:
I have installed lightdm and lightdm-gtk-greeter on the VM. In this case, the lighdm greeter loads properly with system startup, I can start both dwm and cinnamon from the greeter, but in both cases, I am dropped back at the black screen after terminating the session, instead of getting back to the login screen of the greeter (which is what happens on my host machine if I terminate my session).

An other interesting observation I should add is that once the black screen is up, I can't switch between the TTYs in QEMU using the Alt+Fx keys.


The only way... is all the way!

Offline

Board footer

Powered by FluxBB