How to create a Docker container with the CSS Remote Linux lab image.
Step 1 – Install and configure Docker App.
For Windows, if your login account is not part of the Administrators group, then you might also have to do the following:
- Install docker desktop: https://www.docker.com/get-started/
- Run the Docker Desktop installation as the Administrator (Right Mouse Click, “Run as Administrator”)
- Keep all default configuration settings.
- You will need to reboot your machine at the end of the installation.
- Run Computer Management (open Start Menu -> This PC -> select “Manage”) as an Administrator:
- navigate to: Local Users and Groups > Groups > docker-users
- Right-click to add the user to the group.


Log out and log back in for the changes to take effect. Note: For some users Step1 – Part3 might not be necessary and its okay to skip.
4. Launch Docker Desktop App.
When the application is running the Docker icon should be green like shown below.
* You can minimize the Docker Desktop App and continue to the next step.
![]()
Step 2 – Create a container with the CSS remote Linux lab Docker Image.
Execute the following commands on PowerShell for Windows or Terminal application for Mac.
docker pull cssimages/linuxlab
This command will download the docker image (approximately 3GB in size) from docker hub. https://hub.docker.com/r/cssimages/linuxlab
Please make sure to replace “UWnetid” with your actual UW NetID.
Windows users
Windows command – Temporary directory:docker run -ti --name="UWnetidLinuxMachine" -h LinuxMachine -w /home/cssuwbstudent/UWnetid -v C:\tmp\LinuxHome:/home/cssuwbstudent/UWnetid cssimages/linuxlab:latest /bin/bash
This command will setup a docker container with access to your local computer’s C:\tmp\LinuxHome directory. You can move files you need to share with the Linux Machine inside this directory and find them inside the container.
Be mindful that Windows will delete all the files stored in “/tmp/” when it is rebooted, so it is not a good place for students to store their projects. For a more permanent directory Windows users can run the following command instead:
Windows command – Permanent directory:docker run -ti --name="UWnetidLinuxMachine" -h LinuxMachine -w /home/cssuwbstudent/UWnetid -v C:\Users\%username%\Desktop\LinuxHome:/home/cssuwbstudent/UWnetid cssimages/linuxlab:latest /bin/bash
Please make sure to replace “UWnetid” with your actual UW NetID.
Mac Users
Using Terminal application for Mac: Type in the following command
Mac command – Temporary directory:docker run -ti --name="UWnetidLinuxMachine" -h LinuxMachine -w /home/cssuwbstudent/UWnetid -v /tmp/LinuxHome:/home/cssuwbstudent/UWnetid cssimages/linuxlab:latest /bin/bash
Note for Mac Users: The Finder (Explorer) on the Mac normally hides the “/tmp/” directory and could be difficult to locate files created in the container. We recommend Mac users to create a symbolic link to the “/tmp/LinuxHome” directory by executing the following command:ln -s /tmp/LinuxHome ~/LinuxHome
Be mindful that Mac will delete all the files stored in “/tmp/” when it is rebooted, so it is not a good place for students to store their projects. For a more permanent directory Mac users can run the following command instead:
Mac command – Permanent directory:docker run -ti --name="UWnetidLinuxMachine" -h LinuxMachine -w /home/cssuwbstudent/UWnetid -v "/Users/${USER}/LinuxHome":/home/cssuwbstudent/UWnetid cssimages/linuxlab:latest /bin/bash
Options
-t (Allocate a pseudo-TTY) -i (Keep STDIN open even if not attached)--name (Assign the container name)-h (Assign the container hostname)-w (Assign working directory inside the container) -v (Bind mount a volume – C:\tmp\LinuxHome to /home/cssuwbstudent/UWnetid)
Step 3 – Start created containers
You might run into this error if you try running the above command a second time:
– “The container name “UWnetidLinuxMachine” is already in use by container” –
This error means that the container already exists and you should start the container instead.
Please note that the command above is meant to create a container and name it.
You can reuse the container you already created without running the command every time you want to use the container.
- Check for existing containers:
docker container ls -a
- Select container by name to start if not currently running:
docker start UWnetidLinuxMachine
- Create a new bash session inside the container:
docker container exec -it UWnetidLinuxMachine /bin/bash
You should now have a shell in the docker container with access to all your files in your local home directory mounted in the /home/cssuwbstudent/local folder.
Execute the following commands to ensure that everything is installed properly.
ls -al
List all your filespwd
Print your current directorygcc --version
Check the version of your compilerclang-format --versionvalgrind --version

When you are done with your session, you can simply exit the shell which will terminate your container session.
Additionally, the Docker container we just created can be used while working with Visual Studio Code. Follow this link to learn How to attach VSCode to csslab Docker Container. From this point on, you can work completely in the VSCode environment (except, the debugging integration is still not there and you will have to use gdb to debug your programs).
Docker Useful Commands
To list your containers you can use the following command on PowerShell:
docker container ls -a

To rename a container you can use the following command on PowerShell:
docker rename my_old_name_container new_name_container
If you want to remove the Docker container, you can use the following commands on PowerShell:
docker stop name_of_containerdocker rm name_of_container

Or you can also delete the Docker container on the Docker Desktop Application.

If you need to install additional programs on the container, use
sudo dnf install application_name
Troubleshooting Docker Desktop Installation and other Errors
Error – Error during connect: This error may indicate that docker daemon is not running.

Step 1 – Start Docker Desktop App.
Launch the Docker Desktop App and make sure the Docker Daemon is running.
Error – Docker WSL 2 installation is incomplete.
After installation I get the following error: Docker WSL 2 installation is incomplete.
1 – Enable the Windows Subsystem for Linux
Open PowerShell as Administrator (Start menu > PowerShell > right-click > Run as Administrator) and enter this command:
$ dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Step 2 – Check requirements for running WSL 2
To update to WSL 2, you must be running Windows 10…
- For x64 systems: Version 1903 or later, with Build 18362 or later.
- For ARM64 systems: Version 2004 or later, with Build 19041 or later.
or Windows 11.
Step 3 – Enable Virtual Machine feature
Open PowerShell as Administrator (Start menu > PowerShell > right-click > Run as Administrator) and enter this command:
$ dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Step 4 – Download the Linux kernel update package
Download the latest package and install as Administrator:

Step 5 – Set WSL 2 as your default version
![]()
Error – An unexpected error occurred
After installation I get the following error: “Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS”.


Solution 1
- Uninstall Docker Desktop
- Uncheck Containers, Hyper-V, Windows Subsystem for Linux in Windows features
- Click the Start button -> Control Panel -> Programs -> Turn Windows features on or of
- Restart the system
- Install Docker Desktop
- Restart System
- Start Docker Desktop as Administrator
Solution 2
- Uninstall Docker Desktop
- execute
wsl --update(Open PowerShell as Administrator “Start menu > PowerShell > right-click > Run as Administrator”)

- Install Docker Desktop
- Restart System
Solution 3
- Uninstall Docker Desktop
- Restart System
- Install Docker Desktop (Uncheck “Use WSL 2 instead of Hyper-V”)

- Restart System
Error – Virtualization must be enabled in the BIOS
After installation I get the following error: Hardware assisted virtualization and data protection must be enabled in the BIOS.

Solution
The only way to enable the virtualization functionality for your CPU and Operating System is to do so through the BIOS. Please follow this tutorial on How to enable virtualization in BIOS.
