3. Appendix

3.1. Appendix 1: Enabling Virtualization in the BIOS

Different models of computers may have different processes to enable virtualization. Take Lenovo ThinkPad series Windows 10 as an example:

  • Open PC Settings and select Update and Security.

../_images/01316.png ../_images/01414.png
  • Select “Recover”.

../_images/01513.png
  • Select “Restart Now”.

../_images/01614.png
  • Select “Troubleshoot”.

../_images/01714.png
  • Select “Advanced Options”.

../_images/01814.png
  • Select “UEFI Firmware Settings”.

../_images/01913.png
  • Select “Restart”.

../_images/02014.png
  • Select “Virtualization” under Security.

../_images/02114.png
  • Select “Enabled” and press “Enter” to confirm.

../_images/02214.png
  • Press “F10”, select “Yes”, press “Enter” to save changes.

../_images/02314.png

3.2. Appendix 2: Adding a Virtual NIC (Loopback Network Adapter)

  1. Open Device Manager, press “Windows Key - X”, select “Network adapters”.

../_images/02414.png
  1. Add a network.

../_images/02513.png ../_images/02614.png ../_images/02714.png ../_images/02813.png ../_images/02914.png ../_images/03013.png ../_images/03113.png
  1. View the virtual network card, press the “Windows key - X” , select “Network Connection”.

../_images/03213.png ../_images/03314.png ../_images/03414.png ../_images/03514.png
  1. Configuring a Loopback Adapter Network.

  • IP address: 192.168.58.XXX (same network segment as 192.168.58.2) .

  • Subnet mask: 255.255.255.0.

../_images/01215.png
  1. Open the Virtualbox network configuration, select “Loopback Adapter Network” for the network card name, and start the virtual machine.

../_images/01316.png

3.3. Appendix 3: Root Permissions

After Ubuntu is installed, the root user is not allowed to log in by default, and the password is empty. If you want to log in as the root user, you must first set a password for the root user.

  1. Open the terminal, type sudo passwd root, press Enter, and then enter the password several times. A success message will be displayed once the password is set.

../_images/05710.png
  1. Continue in the terminal by entering the command su - root to switch users, and press Enter to input the password.

Warning

When entering the command, be sure to include the hyphen in “su -”. The option “-” signifies that the environment variables should be switched along with the user, and it is crucial not to omit it.

../_images/05810.png

3.4. Appendix 4: Docker Basic Commands

  1. Docker help command:

1docker --help
  1. Start Docker :

1systemctl start docker
  1. Stop Docker :

1systemctl stop docker
  1. Restart Docker :

1systemctl restart docker
  1. Set Docker to start automatically with the service :

1systemctl enable docker
  1. Check the running status of Docker :

1systemctl status docker
2--If it's running, you'll see "active" in green
  1. Docker container :

 1docker images: List the downloaded images.
 2docker rmi [image_id_or_name]: Remove a local image.
 3docker rmi -f [image_id_or_name]: Force remove an image.
 4docker build: Build an image.
 5docker search [image_id_or_name]: Search for an image by keyword in the Hub.
 6docker pull [image_id_or_name]: Download an image
 7docker images: List the downloaded images.
 8docker rmi [image_id_or_name]: Remove a local image.
 9docker rmi -f [image_id_or_name]: Force remove an image.
10docker build: Build an image.
  1. Docker container :

 1docker ps: List running containers.
 2docker ps -a: List all containers, including those not running.
 3docker stop [container_id_or_name]: Stop a container.
 4docker kill [container_id]: Force stop a container.
 5docker start [container_id_or_name]: Start a stopped container.
 6docker inspect [container_id]: View all information about a container.
 7docker container logs [container_id]: View container logs.
 8docker top [container_id]: View processes inside the container.
 9docker exec -it [container_id] /bin/bash: Enter the container.
10exit: Exit the container.
11docker rm [container_id_or_name]: Remove a stopped container.
12docker rm -f [container_id]: Remove a running container.
13docker exec -it [container_ID] sh: Enter the container using the shell.