diff --git a/guest/init.c b/guest/init.c index 837acfb..4fc6aaf 100644 --- a/guest/init.c +++ b/guest/init.c @@ -11,7 +11,7 @@ static int run_process(char *filename) { char *new_argv[] = { filename, NULL }; - char *new_env[] = { NULL }; + char *new_env[] = { "TERM=linux" }; return execve(filename, new_argv, new_env); } @@ -30,6 +30,12 @@ int main(int argc, char *argv[]) do_mounts(); + /* get session leader */ + setsid(); + + /* set controlling terminal */ + ioctl (0, TIOCSCTTY, 1); + puts("Starting '/bin/sh'..."); run_process("/bin/sh");