You are not logged in.

#1 2016-10-12 21:44:01

Earth2
Member
Registered: 2016-04-06
Posts: 13

Running qemu directly through startx

In my present Arch setup, I'm not using a display manager, but instead start my desktop environment of choice using startx.

On the list of environments I've listed, I've included the esoteric TempleOS, which I am attempting to launch using qemu.  I am able to get it to start; however, there are a couple problems I'm unable to fix.

For one, I have a high-DPI monitor, which means that the emulation appears in a tiny window in the upper left of my screen.  Naturally, I would like it to fill the entire screen instead.  I acknowledge of course that TempleOS is designed to strictly support 640x480 resolution, but if I run qemu from inside another window manager and activate fullscreen mode, it properly appears to fill the screen.  I'm not sure how I can fix this from the command line, though I suspect it would be a parameter I pass to startx rather than qemu.

My second question, while I'm at it, is simple but I haven't found a satisfactory answer: is it possible to set qemu so that the emulation initializes with the keyboard and mouse already captured?  Furthermore, I can only quit qemu using Ctrl+Alt+Q if it is not in fullscreen mode.  Can I set it so that a "Quit" hotkey command works from fullscreen mode as well?

For reference, here is the current command I am using for startup:

startx /usr/bin/qemu-system-x86_64 -hda /home/keegan/MyMachines/TempleOS/temple.img -machine kernel_irqchip=off -smp cores=8 -enable-kvm -cpu host -m 1024 -rtc base=localtime -soundhw pcspk -full-screen -- -dpi 192
xrdb -merge ~/.Xresources

And my .Xresources:

!xterm*background: rgb:13/19/29
xterm*background: rgb:00/00/00
xterm*foreground: gray
xterm*faceName: monaco:size=10

Xcursor.theme: whiteglass
Xcursor.size: 96

Xft.dpi: 192

Let me know if you need any more information.

Offline

#2 2016-10-13 06:53:14

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: Running qemu directly through startx

Earth2 wrote:

[...] but if I run qemu from inside another window manager and activate fullscreen mode, it properly appears to fill the screen.  I'm not sure how I can fix this from the command line, though I suspect it would be a parameter I pass to startx rather than qemu.

If you enable "fullscreen mode" in an application, it really just sends an X event for "fullscreen", and then some process "on the other side" (typically the window manager) will handle that event, and maybe resize the window accordingly (of course some applications "cheat" by simply resizing themselves to the resolution of the screen they detect - but that is not a clean way to do things).
As you launch qemu directly without any window manager, there is nothing "on the other side" to handle the event.

I haven't gotten around to search for "kiosk WMs" (i.e. WMs that take one application and just run it focused and fullscreen, ideally restarting it when it terminates), but personally I would probably take some lightweight/tiling WM and auto-launch an application in fullscreen.

For reference, here is the current command I am using for startup:

startx /usr/bin/qemu-system-x86_64 -hda /home/keegan/MyMachines/TempleOS/temple.img -machine kernel_irqchip=off -smp cores=8 -enable-kvm -cpu host -m 1024 -rtc base=localtime -soundhw pcspk -full-screen -- -dpi 192
xrdb -merge ~/.Xresources

I don't think these lines work the way you expect - you launch X with qemu as client, and until X terminates, `xrdb` will not get executed (and consequently, it will probably fail by the time it runs, since it will be running in a TTY).
I think you might need an xinitrc for that kind of stuff.


pkgshackscfgblag

Offline

#3 2016-10-13 07:58:32

Earth2
Member
Registered: 2016-04-06
Posts: 13

Re: Running qemu directly through startx

Thanks for the reply, ayekat.  It's interesting learning all the particulars of how X works, and what I can and can't do properly with it.

That's what I was afraid of...my plan B if this didn't work was gonna be to try running it over ratpoison or something, so I'll see if I can get that to work.  I still would like to know how to kill the emulation while it's in fullscreen; and also, if I'm gonna do it this way, I'll have to tool around and see if I can get the WM to close right after qemu does as well.

Offline

Board footer

Powered by FluxBB