7 | | Details required! |
| 7 | qemu can be built without any graphical environment and run on a server, where the display will be made available by the integrated vnc server. |
| 8 | |
| 9 | Building qemu without any graphical environment on a system that has a graphical environment installed seems to be a bit tricky. I was successfull with the following commands: |
| 10 | {{{ |
| 11 | pathremove $XORG_PREFIX/bin PATH |
| 12 | pathremove $XORG_PREFIX/lib/pkgconfig PKG_CONFIG_PATH |
| 13 | pathremove $XORG_PREFIX/share/pkgconfig PKG_CONFIG_PATH |
| 14 | |
| 15 | pathremove $XORG_PREFIX/lib LIBRARY_PATH |
| 16 | pathremove $XORG_PREFIX/include C_INCLUDE_PATH |
| 17 | pathremove $XORG_PREFIX/include CPLUS_INCLUDE_PATH |
| 18 | |
| 19 | export PATH PKG_CONFIG_PATH ACLOCAL LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH MANPATH |
| 20 | unset XORG_CONFIG |
| 21 | XORG_PREFIX=/opt/X11 |
| 22 | |
| 23 | mkdir build |
| 24 | cd build || exit |
| 25 | |
| 26 | ../configure --prefix=/usr --disable-pa --disable-jack \ |
| 27 | --disable-vte --sysconfdir=/etc --disable-sdl --disable-sdl-image \ |
| 28 | --disable-gtk --enable-vnc --audio-drv-list=alsa --disable-vnc-sasl --enable-kvm \ |
| 29 | --disable-opengl --target-list="$TARGET_LIST" |
| 30 | |
| 31 | make |
| 32 | }}} |
| 33 | |
| 34 | Note that this probably requires to have xorg installed outside /usr, which I have. |
| 35 | |
| 36 | However, you should also be able to run qemu with the display on the integrated vnc server if you have linked against xorg and gtk and whatnot, the most important thing is to build qemu with vnc support, which is achieved by building it with '--enable-vnc --disable-vnc-sasl'. |
| 37 | |
| 38 | |
| 39 | In order to then run a qemu virutal machine on a server and connect to its display on a client, you will only need vncviewer on the client. |
| 40 | |
| 41 | |
| 42 | The port bit of vnc is a bit funny, as the vnc port that you specify on the server is then increased by 5900 by qemu. |
| 43 | |
| 44 | The following will work: |
| 45 | |
| 46 | {{{ |
| 47 | # |
| 48 | # start the qemu vm with vnc display on the server |
| 49 | # |
| 50 | QEMU_LOG_FILE=/tmp/myvm.log |
| 51 | QEMU_SERVER_VNC_ADDR=192.168.219.5 |
| 52 | QEMU_SERVER_VNC_PORT=5942 |
| 53 | |
| 54 | nohup /usr/bin/qemu $ALL_YOUR_USUAL_QEMU_OPTIONS_FOR_THIS_VM -vnc $QEMU_SERVER_VNC_ADDR:$QEMU_SERVER_VNC_PORT > $QEMU_LOG_FILE 2>&1 & |
| 55 | }}} |
| 56 | |
| 57 | qemu will then make the display of the vm available on 192.168.219.5:11842 |
| 58 | |
| 59 | So, on your client desktop, you can then connect to it by: |
| 60 | |
| 61 | {{{ |
| 62 | vncviewer 192.168.219.5:11842 |
| 63 | }}} |
| 64 | |
| 65 | On hindsight, maybe it would be more clever to specify "2" as the vnc server port and the just call it on 5902.... |
| 66 | |
| 67 | Anyway, this works quite well for me, of course I have a couple of scripts to manage this easier. |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |