Installing Docker

Here are installation instructions for installing Docker and running Modelsim for my ELEC3608 Computer Architecture course.

1. Installation

2 Testing

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)
    1. Run XLaunch and configure “Multiple Windows” and “Start no client”
    2. Open a Windows Powershell window
    3. Type ipconfig. Note the IPv4 Address for the Ethernet Adapter vEthernet (WSL). On my machine it was 172.18.240.1
    4. Type set-variable -name DISPLAY -value 172.18.240.1:0.0
  • (MacOS X setup)
    1. Run the Xquartz X Server program by clicking on the icon, an xterm window should appear
    2. Type export DISPLAY=`hostname`:0.0 in the xterm window.
    3. Type 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).

Now type docker run -it -e DISPLAY=$DISPLAY fr3nd/xeyes. You should see the window below and the eyes should move with your mouse.

2.3 Modelsim

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 to /mnt. Use this to access your files and store your outputs.

3 Troubleshooting

  • 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
    1. 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.
    2. 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.
    3. 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

4 Links