kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kvm tools: Export DISPLAY ENV as our default host ip address
@ 2012-08-24 11:29 Asias He
  2012-08-24 11:29 ` [PATCH 2/2] kvm tools: Mount devpts to /dev/pts Asias He
  2012-09-04 13:07 ` [PATCH 1/2] kvm tools: Export DISPLAY ENV as our default host ip address Avi Kivity
  0 siblings, 2 replies; 19+ messages in thread
From: Asias He @ 2012-08-24 11:29 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: Sasha Levin, Ingo Molnar, Cyrill Gorcunov, kvm

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>
---
 tools/kvm/guest/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 }
-- 
1.7.11.4


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-09-10  8:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 11:29 [PATCH 1/2] kvm tools: Export DISPLAY ENV as our default host ip address Asias He
2012-08-24 11:29 ` [PATCH 2/2] kvm tools: Mount devpts to /dev/pts Asias He
2012-09-04 13:07 ` [PATCH 1/2] kvm tools: Export DISPLAY ENV as our default host ip address Avi Kivity
2012-09-05  6:03   ` Asias He
2012-09-05  7:56     ` Avi Kivity
2012-09-05  9:19       ` Asias He
2012-09-05  9:29         ` Avi Kivity
2012-09-05  9:46           ` Asias He
2012-09-05  9:53             ` Avi Kivity
2012-09-05 10:14               ` Asias He
2012-09-05 11:56                 ` Avi Kivity
2012-09-06  3:32                   ` Asias He
2012-09-06  7:59                     ` Avi Kivity
2012-09-10  1:26                       ` Asias He
2012-09-10  8:19                         ` Avi Kivity
2012-09-05  8:00   ` Pekka Enberg
2012-09-05  8:09     ` Ingo Molnar
2012-09-05  9:16       ` Asias He
2012-09-05  9:13     ` Asias He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).