Here are installation instructions for installing Docker and running Modelsim for my ELEC3608 Computer Architecture course.
- Install the VcXsrv X windows server https://sourceforge.net/projects/vcxsrv/
- You will get an alert from Windows Defender. Allow access for Private Networks.
- (Windows 10 Professional, Consumer and Education) Use instructions at https://docs.docker.com/docker-for-windows/install/ to install Stable version of Docker Desktop for Windows (follow them carefully). In the Configuration menu ensure that “Enable WEL 2 Windows Features” and “Add shortcut to desktop” are selected.
- (Windows 10 Home) The same as for Windows 10 except for the Install Docker step where you follow these instructions https://docs.docker.com/docker-for-windows/install-windows-home/
- Run Docker Desktop by double-clicking the icon on the desktop
- Download and install stable version from https://docs.docker.com/docker-for-mac/install/
- Run Docker Desktop by clicking the Docker icon
2.1 Hello world
To test basic Docker functionality, type
docker run hello-world in the command window. Your output should be something like:
Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/
2.2 X Server
We need to use the X Server to display graphical output. This tests X Windows basic functionality.
- (Windows setup)
- Run XLaunch and configure “Multiple Windows” and “Start no client”
- Open a Windows Powershell window
ipconfig. Note the IPv4 Address for the Ethernet Adapter vEthernet (WSL). On my machine it was 172.18.240.1
set-variable -name DISPLAY -value 172.18.240.1:0.0
- (MacOS X setup)
- Run the
XquartzX Server program by clicking on the icon, an xterm window should appear
export DISPLAY=`hostname`:0.0in the xterm window.
xhost +(if you get an error, check in Xquartz -> Preferences that “Authenticate connections” has no tick and “Allow connections from network clients” has a tick).
- Run the
docker run -it -e DISPLAY=$DISPLAY fr3nd/xeyes. You should see the window below and the eyes should move with your mouse.
Finally, this tests the Docker image for Modelsim (the executable is called
vsim). Make sure you have set up your X Server and can execute the
previous Xeyes example.
- (Windows) If your home directory is “C:\Users\XX YY”, you should now be able to run vsim
docker run -it -e DISPLAY=$DISPLAY -v C:\Users\"XX YY":/mnt phwl/elec3608-vsim:latest vsim(note the position of the quotes).
- (MacOS) You should now be able to run vsim
docker run -it -e DISPLAY=$DISPLAY -v $HOME:/mnt phwl/elec3608-vsim:latest vsim.
If everything works, the Modelsim window should appear.
Within Docker, the directory on your local home directory will be mapped
/mnt. Use this to access your files and store your outputs.
- Update your operating system to the latest version. My Windows 10 Pro installation was on Version 2004 (OS Build 19041.388) available https://www.microsoft.com/en-us/software-download/windows10ISO.
- Check you have virtualization enabled in your BIOS
- Reboot the computer and open the system’s BIOS menu. This can usually be done by pressing the delete key, the F1 key or Alt and F4 keys depending on the system.
- Enabling the virtualization extensions in BIOS. Open the Processor submenu The processor settings menu may be hidden in the Chipset, Advanced CPU Configuration or Northbridge. Enable Intel Virtualization Technology (also known as Intel VT-x). AMD-V extensions cannot be disabled in the BIOS and should already be enabled. The virtualization extensions may be labeled Virtualization Extensions, Vanderpool or various other names depending on the OEM and system BIOS. Enable Intel VT-d or AMD IOMMU, if the options are available. Intel VT-d and AMD IOMMU are used for PCI device assignment.
- Select Save & Exit.
- If you are using Windows Home, you might like to update to the (more powerful) Windows 10 Education, Version 1809, available here. After installing, update to the latest version.
- Niansong Zhang compiled this list at the NOVA’19 workshop
- The Docker image is derived from one provided by Prof Nachiket Kapre (Waterloo). If you want to create your own variant, the scripts used to create it are available here.
- Notes on Docker support under Windows Home with WSL 2 https://www.docker.com/blog/docker-desktop-for-windows-home-is-here/ (from Dr Peter Jones)
- Notes on WSL 2 and Hyper-V https://devblogs.microsoft.com/commandline/wsl-2-post-build-faq/ (from Dr Peter Jones)