From patchwork Fri Aug 24 11:29:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 1370711 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id EE79CDF28C for ; Fri, 24 Aug 2012 11:30:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756980Ab2HXLaw (ORCPT ); Fri, 24 Aug 2012 07:30:52 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=XpNN2tePJrZM70Grrcy89f5E274eMM4kPGHNnXk4A5c=; b=FmvKIgUg4hMAbGbf1OYWpMmeznQpUB1MRPDVP6NwuY5OfmB/QZ1DCg057mm4ztrZEg tJ/Gi0h2cJXSBLvBF0WgKLk9bGWV6KcCuKLgLi3KSTJ3YKR5/FEeLypQaYHU0RW6M9XD 3fVVc4x5g3pCIUiPIL7RF5ozjQ8HktABfB7cDNvHS3Fti9U6SHu659W+BWR6+A4mIaGN gzR89nig/fc2hZPdSP5QcBRxaXNW+KSCCQxRzl6qvZyI7Xd4qdjoC4QQ69xlvPWP/FvZ E4IqdQt9aKLj//QMB57w/FbeiB0SPeb4yeAHC10xPpH8p9idLm0sweUqfmppk9PuCFfj nL6Q== Received: by 10.68.193.196 with SMTP id hq4mr12495027pbc.32.1345807848753; Fri, 24 Aug 2012 04:30:48 -0700 (PDT) Received: from hj.localdomain ([58.194.229.103]) by mx.google.com with ESMTPS id nk3sm8139633pbc.27.2012.08.24.04.30.46 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Aug 2012 04:30:47 -0700 (PDT) From: Asias He To: Pekka Enberg Cc: Sasha Levin , Ingo Molnar , Cyrill Gorcunov , kvm@vger.kernel.org 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> X-Mailer: git-send-email 1.7.11.4 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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); }