My case is to get some stdio output from console with QEMU. Unfortunately, it is not possible to run QEMU with & command.
An alternative way is that using screen to keep ssh session running when you disconnect.
Assume I have a PC with linux shell to connect to cluster:
I use the following option to set up my qemu vm and output to a file called result.txt:
Press Ctrl + A and then Ctrl + D in immediate succession.
And now it is disconnected.
To reconnect to the session
If you have multiple sessions like my case, you need to specify the session you are going to resume:
There are several suitable screens on:
3390.pts-13.ls12sq (Detached)
3646.pts-13.ls12sq (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
In my case, I can type the following command to resume 3390.
To kill session, Ctrl + A and than Ctrl + K, or exit the terminal.
Reference from:
http://www.howtogeek.com/howto/ubuntu/keep-your-ssh-session-running-when-you-disconnect/
------------------
The following is the Q&A for different potential errors:
An alternative way is that using screen to keep ssh session running when you disconnect.
Assume I have a PC with linux shell to connect to cluster:
screen ssh yourname@clusterpc
I use the following option to set up my qemu vm and output to a file called result.txt:
qemu-system-arm -no-reboot -nographic -M realview-pbx-a9 -m 256M -kernel \ kernel file >> result.txtAfter this command, the vm is started.
Press Ctrl + A and then Ctrl + D in immediate succession.
And now it is disconnected.
To reconnect to the session
screen -r
If you have multiple sessions like my case, you need to specify the session you are going to resume:
There are several suitable screens on:
3390.pts-13.ls12sq (Detached)
3646.pts-13.ls12sq (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.
In my case, I can type the following command to resume 3390.
screen -r 3390
To kill session, Ctrl + A and than Ctrl + K, or exit the terminal.
Reference from:
http://www.howtogeek.com/howto/ubuntu/keep-your-ssh-session-running-when-you-disconnect/
------------------
The following is the Q&A for different potential errors:
- error opening terminal: xterm-256color
- export TERM=xterm
- No command for screen
- sudo apt-get install screen
Comments
Post a Comment