Code Monkey home page Code Monkey logo

vm-faq-from-students's Introduction

FAQs of VMs

Last Update: 05.10.2023

1. "Failed to access data from shortcut"

Problem Download the VM from the COM-301 homework website, then doubleclick the extracted utm file, UTM application shows an error saying "Failed to access data from shortcut"

Solution After searching for the error message, this is a known issue of UTM. As this reply says, run the following command to delete the metadata file will solve the problem:

rm ~/Library/Containers/com.utmapp.UTM/.com.apple.containermanagerd.metadata.plist

2. No network connection in the VM

Problem the VM has problem reaching the internet, e.g.,

student@com301-stuent-vm:~$ ping 1.1.1.1
ping: connect: Network is unreachable

Solution This is because the hardware emulation order changes (see the documentation from the official UTM guide), so the names of network interfaces are mismatched. Run the following two commands and notice the mismatched enp0s1 and enp0s6:

Network interface names mismatch

The above screenshot should be the case if the host device is MacOS, the interface information is in the file under path /etc/netplan/00-installer-config.yaml. For other OS, the file can be in other paths, e.g., /etc/network/interfaces

There are three steps required to fix this network issue.

First, we edit the names in the interface file (/etc/netplan/00-installer-config.yaml or /etc/network/interfaces) to make sure it is consistent with the output of ip link show:

student@com301-stuent-vm:~$ sudo nano /etc/netplan/00-installer-config.yaml

Edit the file, save the changes and close the file.

Second, bring up the real interface (enp0s1 in our example):

student@com301-stuent-vm:~$ sudo ip link set enp0s1 up

To check the changes in the first two steps are actually correct:

after changing the interface name and bring up the interface

Last, reboot the VM, you can do it using the power off button or just type in the terminal:

student@com301-stuent-vm:~$ reboot

Now, the network issue should be solved, verify it by:

network is good using ping

3. Non-english keyboard

Problem the keyboard of the VM does not match with the keyboard of host device, which makes it really hard to type some special charaters like - in a command

Solution In the VM, go to right up corner, click the Settings -> Region & Language -> Input Source, click the + at the bottom, add an English keyboard input, e.g., English (US). Then we should be able to see the English keyboard is added as an input source. Then click the keyboard icon at the top to choose from the keyboards, as the following screenshot:

adding English keyboard

4. No code editor

Problem It is very clumsy to edit code via terminal, an editor would be more convenient.

Solution There are many code editors, and you are free to choose the one you prefer. We use vscodium as an example tool in the following.

First, open firefox on the VM, go to the downloading page of vscodium: https://vscodium.com/#install-on-debian-ubuntu-deb-package

Second, follow the instructions to run:

student@com301-stuent-vm:~$ wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
    | gpg --dearmor \
    | sudo dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
student@com301-stuent-vm:~$ echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' \
    | sudo tee /etc/apt/sources.list.d/vscodium.list
student@com301-stuent-vm:~$ sudo apt update && sudo apt install codium

install vscodium

After the installation is finished, you can open vscodium by click on the icon or just run:

student@com301-stuent-vm:~$ codium .

Now you have the code editor, enjoy ;)

5. Can connect to the Internet, but not com301.epfl.ch

Problem It is possible to access the Internet but not com301.epfl.ch via a browser or the terminal.

Symptoms Pinging com301.epfl.ch resolves the hostname to 127.0.1.1 but pinging any other website pings to a normal IP.

Solution One solution of this problem is the configuration of the VM.

Inside a terminal,

$ cat /etc/hosts

It prints the content of the file /etc/hosts.

If the following line appears:

127.0.1.1            com301.epfl.ch com301

You should remove that line using any editor: the quickest way is to use nano:

$ sudo nano /etc/hosts

and it should work!

vm-faq-from-students's People

Contributors

maeeen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.