Add a HOME env var when booting a hostfs guest. This will point out to a home
dir within the given guest name.

This will make several apps happier when being run under hostfs.

Signed-off-by: Sasha Levin <[email protected]>
---
 tools/kvm/guest/init.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/kvm/guest/init.c b/tools/kvm/guest/init.c
index e1f377f..9655bdf 100644
--- a/tools/kvm/guest/init.c
+++ b/tools/kvm/guest/init.c
@@ -12,7 +12,10 @@
 static int run_process(char *filename)
 {
        char *new_argv[] = { filename, NULL };
-       char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0", NULL };
+       char *new_env[] = { "TERM=linux", "DISPLAY=192.168.33.1:0",
+                               "HOME=/virt/home", NULL };
+
+       mkdir("/virt/home", 0755);
 
        return execve(filename, new_argv, new_env);
 }
-- 
1.7.12

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to