]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Export DISPLAY ENV as our default host ip address
authorAsias He <asias.hejun@gmail.com>
Fri, 24 Aug 2012 11:29:40 +0000 (19:29 +0800)
committerPekka Enberg <penberg@kernel.org>
Fri, 24 Aug 2012 13:15:50 +0000 (16:15 +0300)
It is useful to run a X program in guest and display it on host.

1) Make host's x server listen to localhost:6000
   host_shell$ socat -d -d TCP-LISTEN:6000,fork,bind=localhost \
               UNIX-CONNECT:/tmp/.X11-unix/X0

2) Start the guest and run X program
   host_shell$ lkvm run -k /boot/bzImage
  guest_shell$ xlogo

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/guest/init.c

index 6a2e1cdbb0d33c9efff5b6c0c40dc161987613a1..44e7db811c47139dc87a18a6b46f5e6048be45e0 100644 (file)
@@ -12,7 +12,7 @@
 static int run_process(char *filename)
 {
        char *new_argv[] = { filename, NULL };
-       char *new_env[] = { "TERM=linux", NULL };
+       char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0", NULL };
 
        return execve(filename, new_argv, new_env);
 }