[tip:tools/kvm] kvm tools: Export DISPLAY ENV as our default host ip address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  ce3450f368855f270a8877650844077479737de5
Gitweb:     http://git.kernel.org/tip/ce3450f368855f270a8877650844077479737de5
Author:     Asias He <asias.hejun@xxxxxxxxx>
AuthorDate: Fri, 24 Aug 2012 19:29:40 +0800
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Fri, 24 Aug 2012 16:15:50 +0300

kvm tools: Export DISPLAY ENV as our default host ip address

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@xxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/guest/init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/kvm/guest/init.c b/tools/kvm/guest/init.c
index 6a2e1cd..44e7db8 100644
--- a/tools/kvm/guest/init.c
+++ b/tools/kvm/guest/init.c
@@ -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);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux