Changes between Version 10 and Version 11 of qemu


Ignore:
Timestamp:
04/21/2022 06:08:41 PM (2 years ago)
Author:
Tim Tassonis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • qemu

    v10 v11  
    55== Use as a server ==
    66
    7 Details required!
     7qemu 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
     9Building 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{{{
     11pathremove $XORG_PREFIX/bin             PATH
     12pathremove $XORG_PREFIX/lib/pkgconfig   PKG_CONFIG_PATH
     13pathremove $XORG_PREFIX/share/pkgconfig PKG_CONFIG_PATH
     14
     15pathremove $XORG_PREFIX/lib             LIBRARY_PATH
     16pathremove $XORG_PREFIX/include         C_INCLUDE_PATH
     17pathremove $XORG_PREFIX/include         CPLUS_INCLUDE_PATH
     18
     19export PATH PKG_CONFIG_PATH ACLOCAL LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH MANPATH
     20unset XORG_CONFIG
     21XORG_PREFIX=/opt/X11
     22
     23mkdir build
     24cd 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
     31make
     32}}}
     33
     34Note that this probably requires to have xorg installed outside /usr, which I have.
     35
     36However, 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
     39In 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
     42The 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
     44The following will work:
     45
     46{{{
     47#
     48# start the qemu vm with vnc display on the server
     49#
     50QEMU_LOG_FILE=/tmp/myvm.log
     51QEMU_SERVER_VNC_ADDR=192.168.219.5
     52QEMU_SERVER_VNC_PORT=5942
     53
     54nohup /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
     57qemu will then make the display of the vm available on 192.168.219.5:11842
     58
     59So, on your client desktop, you can then connect to it by:
     60
     61{{{
     62vncviewer 192.168.219.5:11842
     63}}}
     64
     65On hindsight, maybe it would be more clever to specify "2" as the vnc server port and the just call it on 5902....
     66
     67Anyway, 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
    875
    976