From: Asias He Subject: [PATCH 1/2] kvm tools: Export DISPLAY ENV as our default host ip address Date: Fri, 24 Aug 2012 19:29:40 +0800 Message-ID: <1345807781-23452-1-git-send-email-asias.hejun@gmail.com> Cc: Sasha Levin , Ingo Molnar , Cyrill Gorcunov , kvm@vger.kernel.org To: Pekka Enberg Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:48771 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752896Ab2HXLat (ORCPT ); Fri, 24 Aug 2012 07:30:49 -0400 Received: by pbbrr13 with SMTP id rr13so3301930pbb.19 for ; Fri, 24 Aug 2012 04:30:48 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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