How to install the VM & (Docker/VM) FAQ

First, download the VM.
You can find the installing instructions and further helpful information here.

There is also a step-by-step video of one of the last iterations:

It’s in German, but you will probably be able to follow the instructions by watching it. If not, you can just ask in the Forum.

FAQ and problems that can occur and their solutions:

  • Virtualization in BIOS disabled.
    Enter BIOS: How to Enter the BIOS on Windows 10 (And Older Versions)
    (Common keys: F2, F5, F12, Delete)
    Enable: Security → Virtualization → enable all
    Note that in your BIOS, these options might be called something else
  • Windows 10: VM does not boot (hangs on VirtualBox logo)
    Right-click on the Windows logo in the taskbar → open Powershell (Administrator).
    Type “bcdedit /set hypervisorlaunchtype off”, press Enter and restart the computer.
    Note: WSL and Docker are clashing with the VM here. The setting made above will be reset on a new reboot if necessary.
  • Mac: Virtualbox has not enough installation permissions
    System Preferences → Security & Privacy → Allow
    System Preferences → Security & Privacy → Privacy: allow access to Input Monitoring, Files and Folders, Screen Recording
  • No Internet in VM
    VirtualBox: Settings → Network → Adapter1: select “enable network adapter” and “attached to NAT”
  • VM only shows a black screen
    In VirtualBox: Settings → Display → Screen → Acceleration: select “enable 3D acceleration”
  • Appliance can not be imported
    → VM installer or image broken. (Download again)
    check checksums
    E.g. on Windows with 7-Zip by right-clicking on the file → CRC SHA → SHA-256

If you cannot find the solution to your problem here, please check https://cms.sic.saarland/prog2_22/4/Software to find further technical information.
Also, feel free to ask questions about the VM in this forum category

2 Likes

When running into this exception:

docker: Error response from daemon: create ./Workspace: "./Workspace" includes invalid characters for a local volume name, only ......

You will need to edit the script install_extensions.sh and start_container.sh (Right Click → Open with: TextEdit):

Replace the line:

CURDIR=$(dirname "$(readlink -f "$0")")

with

CURDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

or (:warning: read the notes below :warning:)

CURDIR=$PWD

in both files.
Don’t forget to save the files.

Be Careful

Even though the second fix seems easier, it has a flaw:

If you run the script from a different directory than the scripts directory, you will create a new Workspace folder, which is the folder available inside the docker container. The first fix will make sure, the same Workspace folder is used every time, such that all your files are available every time.

Why?

Imagine this folder structure and a script with the second fix:

- ~ (Home)
| - Prog2Docker:
  | - start_container.sh
  | - install_extensions.sh
  | - ... other files from the zip archive

If you are inside the Prog2Docker directory and run the script (./start_container), it will create a Workspace directory and use it inside the container. If you now run your from the ~ directory (./Prog2Docker/start_container) a new Workspace folder will be created in your ~ directory and used inside the Docker Container.

This is due to how variable PWD is set. As you may know, the command pwd prints the current working directory. PWD is usually set to the value of pwd. When you are in Prog2Docker, pwd will output something like /home/<USERNAME>/Prog2Docker, in the ~ folder it will just be /home/<USERNAME>/. When running the script, the working directory itself is not changed, therefore PWD will not be overwritten to be the directory of your script.

Then why does it work with the other fix? With this solution, we first set the working directory of our execution to the scripts directory and use it.

Try it yourself

Create a script inside a folder with this content:

#!/bin/bash

echo $PWD
echo $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

After doing chmod +x <filename> (<filename> being the name you gave your script) to make it executable, go up one directory (cd ..) and run it from there. You will see, that the first line of output will still output your working directory, while the second line of output will show the scripts location.

3 Likes