Skip to main content

VMware for Robotics

info

Despite most PCs and laptops running Windows, robotics is easier to tackle using Linux. The VirtualMachine (VM) allows you to run Linux environment on your Windows machine without the hassle of dual booting.

info

VMware is a virtualization software that allows multiple operating systems to run on a single physical machine. It creates a virtual environment, also known as a virtual machine, that simulates the hardware of a physical computer and allows an operating system to run on it as if it were installed on a physical machine.

There are several popular virtualization software products available, including:VMware, VirtualBox, Hyper-V, KVM, ...

Ubuntu Focal on VMware VM

Create a Ubuntu Server 20.04.06 LTS 64-bit VMware Virtual Machine

  1. Download the server install image of Ubuntu Server 20.04.06 LTS 64-bit
  2. Launch VMware Workstation or VMware Workstation Player. Click on the Create a New Virtual Machine option present on the home page.
  3. The New Virtual Machine Wizard window will launch. Click on the I will install the operating system later option and then click Next.
  4. Now you need to select the guest operating system. Click on the Linux radio button and pick Ubuntu 64-bit from the drop-down list. Then, click Next.
  5. Create a new folder and pick that folder as the storage location.
  6. Go with the recommended size of 20GB if you want to merely try out the OS. You can increase the size later on. Keep the Split virtual disk into multiple files option checked and hit Next.
  7. The following window will showcase a summary of the virtual machine settings. However, you still haven’t configured the processor cores, RAM, and other settings. To do so, click on the Customize Hardware button.
  8. 4GB of RAM is enough for Ubuntu, assign two cores or more, depending on your host machine.
  9. Click the CD/DVD (SATA) option and select Use ISO image file. Then, click Browse and select the Ubuntu ISO file. Finally, click Open.
  10. on the Options tab set in the Advance section : check the option "Side channel mitigations .." and firmware type to UEFI. Without choosing firmawre typep UEFI on my computer Ubuntu froze
  11. Press the Play button to power on the Virtual Machine - Install Ubuntu Linux on VMWare Workstation

Install Ubuntu Linux on VMware Workstation

  1. I leave all the options in the default settings
  2. I chose computer name, username and password
  3. After installation, disconnect the install image and restart VM

Update and install useful tools

  1. IP adresa VM

    ip a
  2. Connect to ubuntu VM via ssh or work in VMware window, I use mRemoteNG for ssh and RDP connections

  3. Update your system.

    sudo apt-get update 
    sudo apt-get upgrade
    sudo reboot
  4. Install Midnight Commander (mc)

    sudo apt-get install mc
  5. Install Ubuntu Desktop

    tip

    Ubuntu Server by default does not support running GUI apps however there are ways around it.

    sudo apt-get update && sudo apt-get upgrade && sudo apt-get install ubuntu-desktop
    sudo reboot
  6. Prepare a explicitly setting the dhcp client identifier to mac. After cloning VMs that are running Ubuntu as Guest Operating System (OS) occurs that the new VMs acquire the same DHCP IP addresses from the DHCP server :

    sudo nano /etc/netplan/00-installer-config.yaml

    The following is an example, section default

    network:
    ethernets:
    default:
    match:
    name: e*
    dhcp4: yes
    dhcp-identifier: mac
    ens33:
    dhcp4: true
    version: 2

    To update your netplan configurations, run the netplan apply command.

    sudo netplan apply
  7. Installation of recommended tools - recommended not necessary

    • Double Commander
      sudo apt install doublecmd-gtk

Remote desktop connections

info

Remote Desktop Connection (RDP) is a feature that allows you to connect to a remote computer or virtual machine and control it as if they were sitting directly in front of it. On Ubuntu, you can use RDP through the xrdp software, which provides an RDP server for client connections.

Follow the instructions Install Xrdp On Ubuntu 20, do not run firewall

  1. These are the commands:
    Note: Ubuntu has a display manager by the name Lightdm by default installed. In some versions, another display manager is installed, too, which is Gdm3. If both of them are installed on your Ubuntu server, you will be asked to choose one. If you faced this, choose lightdm.
    sudo apt-get update -y
    sudo apt install xubuntu-desktop -y
    sudo apt install xrdp -y
    sudo systemctl status xrdp
    sudo adduser xrdp ssl-cert
    sudo systemctl restart xrdp
  2. Create a file called .xsession in the home folder
    echo -e  "startxfce4\n" >> ~/.xsession
    chmod +x ~/.xsession

Troubleshooting:

  • light-locker

    • Po připojení ke vzdálené ploše :
      ProblemType: Crash
      Package: light-locker 1.8.0-1ubuntu1
    • Odinstalovat light-locekr:
      sudo apt-get remove light-locker
      sudo reboot
  • Log files

    • xRDP writes some log files into your system. We would recommend you to have a look at these log files. These logs files might provide useful insight about the problem you are encountering.

    • You should look at the following files:

      cat ~/.xsession-errors
      cat /var/log/xrdp.log
      cat /var/log/xrdp-sesman.log
  • How to Fix “Authentication is required to create a color profile/managed device”

    • The key has to do with PolKit version. If your system uses PolKit < 0.106, then you will need a .pkla file as opposed to a .conf file. You can find out the version of PolKit you have by running pkaction --version command. On Ubuntu 20.04, I got pkaction version 0.105
    • create a new configuration file in /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla
      sudo nano /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla
    • Paste in the following:
      [Allow Colord all Users]
      Identity=unix-user:*
      Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
      ResultAny=no
      ResultInactive=no
      ResultActive=yes
    • Save and exit (press CTRL + X, press Y and then press ENTER)
    • Now reboot Ubuntu
  • Disable the screen lock in ubuntu

    gsettings set org.gnome.desktop.screensaver lock-enabled true

ROS2 setup

Continue according to the instructions in the ROS2 section