Update: Corrected two typos/errors. First, the filename atlas-jupyter.sh was replaced by the correct filename atlas-jupyter.service. Second, the notebook option is called –no-browser not –nobrowser.
In this video the ATLAS Experiment explains how to log on to the virtual machine and start the Jupyter server
There is a way to automate this, of course, so that the Jupyter server starts automatically at boot-up of the virtual machine.
Here’s how I did it.
First, I adapted the run-jupyter-server.sh script to the following:
#!/bin/bash source /home/student/ROOT/build/bin/thisroot.sh /home/student/.local/bin/jupyter notebook --ip=0.0.0.0 --no-browser --notebook-dir=/home/student
Then I sudoed to root and went to the directory /lib/systemd/system and created a file called atlas-jupyter.service with the following contents:
[Unit] Description=ATLAS Jupyter Notebook Service [Service] Type=simple PIDFile=/run/atlas-jupyter.pid ExecStart=/home/student/run-jupyter-server.sh User=student Group=student WorkingDirectory=/home/student Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
Then I saved this file and enabled the service with
sudo systemctl enable atlas-jupyter.service
After that I could start it by typing
sudo systemctl start atlas-jupyter.service
And the Jupyter server now starts without problem every time I boot the virtual machine and I don’t have to log in and can also start the virtual machine in headless mode, meaning no console (GUI) necessary.