I have a workstation at my work, on which I want to run a simulation from a remote…
- User
I have a workstation at my work, on which I want to run a simulation from a remote location using ssh. Now, I want this simulation to continue while I can close the terminal with which I started it. What method would you recommend to do this? I am using Fedora Linux on both machines.
Assistant
Recommended Method: Using
nohuporscreenTo run a simulation on a remote workstation and keep it running after closing the terminal, you can use either
nohuporscreen. Both methods are suitable for Fedora Linux.Method 1: Using
nohup- Connect to the remote workstation using SSH:
ssh user@remote_workstation - Run the simulation with
nohup:nohup ./your_simulation_command &nohupignores the SIGHUP signal, which is sent when the terminal is closed.- The
&at the end runs the command in the background.
- Close the terminal: You can now close the terminal, and the simulation will continue running.
Method 2: Using
screen- Connect to the remote workstation using SSH:
ssh user@remote_workstation - Start a new
screensession:screen -S simulation- This creates a new screen session named "simulation".
- Run the simulation:
./your_simulation_command - Detach from the screen session: Press
Ctrl+Afollowed byD(or typescreen -d -r simulationin a new terminal).- This detaches the screen session, allowing you to close the terminal while keeping the simulation running.
- Reattach to the screen session (optional):
screen -r simulation- If you need to check on the simulation or stop it, you can reattach to the screen session.
Additional Tips
- Make sure to replace
./your_simulation_commandwith the actual command to run your simulation. - If you're using
nohup, you can check the simulation's output by looking at thenohup.outfile in the current working directory. - If you're using
screen, you can list all running screen sessions withscreen -lsand kill a session withscreen -S simulation -X quit.
- Connect to the remote workstation using SSH:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.