Version 2 (modified by ken@…, 8 years ago) ( diff )



There are many different ways of using qemu. Hopefully, people will add notes for what they do.

Use as a server

Details required!

Xorg drivers if using qemu to build an LFS desktop guest

For a guest BLFS system, as of late 2014 there are three choices for the graphics driver:

1. the old cirrus driver, which is in BLFS

This is old, but still available. It is incompatible with KMS (Kernel Mode Setting). If you need to use it, pass '-vga cirrus' on the command line. The maximum resolution is 1024x768. If you use this and wish to use a framebuffer outside of Xorg, pass 'vga=790' on the grub commandline.

2. the vmware driver, which is also in BLFS

For me, this comes up as 1024x768 if the CONFIG_FB and CONFIG_DRM_VMWGFX kernel options are set, or 800x600 if they are not. It supports a large maximum resolution (bigger than my screen). Works ok, but the window gets some coloured pixels when it first starts (ok after a second or two). Again, it needs 'vga=790' if you want a framebuffer outside of Xorg. Invoke qemu with '-vga vmware'.

3. the modesetting driver

This is a recent development and is not yet in BLFS. The functionality has apparently been merged into the xorg server for the 1.17 version. Meanwhile, xf86-video-modesetting-0.9.0 is available alongside the other drivers, and works fine. It requires CONFIG_FB, CONFIG_DRM_BOCHS, and should also use CONFIG_DRM_CIRRUS_QEMU in your kernel config. For me this defaults to 1024x768 and offers modes up to 1600x1200 or 1680x1050. The framebuffer (1024x768 pixels) will come up without needing to be specified (yea! penguin(s)!). Invoke qemu either without specifying the vga (because this is the default), or by specifying '-vga std'.

If the 1024x768 framebuffer console is too small to read, enable the 12x22 font in the kernel, you can optionally use the LatGrkCyr-12x22 font in /etc/sysconfig/console provided you are running a UTF-8 system. On a regular machine, you could specify a smaller screen with e.g. video=800x600 or whatever on the kernel commandline, and everything would be scaled up. But in qemu that just gives you a smaller window until Xorg is active.

the vga driver

Only mentioned so I can say "Use a better driver!" This is Xorg's last-gasp attempt to provide a driver. It works, but for me it appears to provide a 1280x768 window into a 1280x960 screen (or something like that - the log mentioned 1280, I thought it was more like 1024). So, it starts with the top part of the screen, but shows the bottom when you move the mouse down.

other notes on setting up Xorg in a guest

For the mouse, use the evdev driver.

To get other screen sizes, use xrandr. To see which modes are supported you should run 'xrandr' and make a note of both the modes (sizes) and the output (in qemu, there is only one output, but its name varies with different drivers). You can then invoke xrandr with a line like the following (for the modesetting driver), and if you like it you can add it to the .xinitrc.

xrandr --output Virtual-0 --mode 1280x960


Note: See TracWiki for help on using the wiki.