Skip to content

Ubuntu Docker image with VNC & JupyterLab. It's convenient to use as a pre-configured environment.

Notifications You must be signed in to change notification settings

dh031200/ubuntu-vnc-jupyter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ubuntu-VNC-Jupyter

Ubuntu Docker image with VNC & JupyterLab.
It's convenient to use as a pre-configured environment.
Just download image and run it!

Container Environment

  • Ubuntu 22.04.1 LTS
  • Xfce 4.16.1
  • TigerVNC 1.12.0
  • Miniconda 23.1.0
  • JupyterLab 3.6.1
  • Simple kernel connector

Installation

git clone https://github.com/dh031200/ubuntu-vnc-jupyter.git
cd ubuntu-vnc-jupyter

# python3 change_user_name.py --new <username>
python3 change_user_name.py --new vncbuntu

./build_docker.sh

# Default Jupyterlab port : 3131
# Default vnc port : 25901

./start_docker.sh

Installation

Initialize

Step 1. Change Password

Current password is   ↓↓↓
Changing password for vncbuntu.
Current password: 
               # Type vncbuntu
New password:
               # Type new password
Retype new password:
               # One more time
passwd: password updated successfully

Setp 2. Set VNC Server

Do you want to set VNCserver [Y/n]
y # Or type `n` for skip
Enter password 2 times to set vnc password.
Then choose 'n' for fully control.

You will require a password to access your desktops.

Password:
      # Type password for connect vnc
Verify:
      # One more time
Would you like to enter a view-only password (y/n)? n
                                                # enter `n` for get control
A view-only password is not used
/usr/bin/xauth:  file /home/vncbuntu/.Xauthority does not exist

New Xtigervnc server '732e9cf19ba0:1 (vncbuntu)' on port 5901 for display :1.
Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /home/vncbuntu/.vnc/passwd 732e9cf19ba0:1 to connect to the VNC server.

Step 3. Install miniconda

Do you want to install miniconda [Y/n]
y # Or type `n` for skip

Welcome to Miniconda3 py310_23.1.0-1
...
...
Do you accept the license terms? [yes|no]
[no] >>> yes
...
...
Miniconda3 will now be installed into this location:
/home/vncbuntu/miniconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/vncbuntu/miniconda3] >>>
                               # Press enter
...
...
Do you wish the installer to initialize Miniconda3
by running conda init? [yes|no]
[no] >>> yes
    # Enter `yes` for conda init

Step 4. Install JupyterLab

Do you want to install JupyterLab [Y/n]
y # Or type `n` for skip

Collecting jupyterlab
  Downloading jupyterlab-3.6.1-py3-none-any.whl (8.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.9/8.9 MB 35.7 MB/s eta 0:00:00
...
...
Do you want to automatically start jupyterlab when you start the container? [Y/n]
y # Or type `n` for start manually

Step 5. Change JupyterLab Password

# You can see below output.
    To access the server, open this file in a browser:
        file:///home/vncbuntu/.local/share/jupyter/runtime/jpserver-398-open.html
    Or copy and paste one of these URLs:
        http://732e9cf19ba0:8888/lab?token=dd3b4c3873add15b32c1f24e3b11d0b6a983fd263c1fd692
        http://127.0.0.1:8888/lab?token=dd3b4c3873add15b32c1f24e3b11d0b6a983fd263c1fd692
                                        ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑
Please set your Password for jupyterlab using the token above.

JupyterLab URL

For example: http://localhost:3131/

Change password from here
Jupyer_password

Connect VNC

You can use any VNC viewer
Use RealVNC for following example : https://www.realvnc.com/en/connect/download/viewer/

VNC Server

  • localhost:25901

Process

VNC_EXAMPLE_1 VNC_EXAMPLE_2

VNC Screen

VNC_EXAMPLE_4

Connect conda environment to jupyter notebook kernel

In terminal

conda create -n test  # Example for new environment

# Output:
#     ...  
#     Proceed ([y]/n)? 
#     ...
#     To activate this environment, use
#
#         $ conda activate test
#
#     To deactivate an active environment, use
#
#         $ conda deactivate

connect_kernel test  # Usage: connect_kernel <Conda env name>

# Output:
#     done
#     Retrieving notices: ...working... done
#     Connect conda environment to jupyter notebook kernel..
#     Installed kernelspec test in /root/.local/share/jupyter/kernels/test
#     ------------------------------------------------------------------------------------
#     [ListKernelSpecs] WARNING | Config option `kernel_spec_manager_class` not recognized by `ListKernelSpecs`.
#     Available kernels:
#       test       /root/.local/share/jupyter/kernels/test
#       python3    /root/miniconda3/envs/test/share/jupyter/kernels/python3

You can see new kernel in JupyterLab

This command is also available in the JupyterLab
Launcher -> Terminal -> Type su <username> command -> Same as above


TODO

  • Document --- Keep updating..
  • Image for wsl --- Done!
  • Image for plain ubuntu --- Done!

About

Ubuntu Docker image with VNC & JupyterLab. It's convenient to use as a pre-configured environment.

Topics

Resources

Stars

Watchers

Forks