Skip to content

Workarounds for MacOS

Philipp van Kempen edited this page Apr 28, 2020 · 6 revisions

Unfortunately there is some bug in Virtualbox for OSX causing the Emulator running in the Lubuntu Image to miss almost everything Mouse and Keyboard event, as you probably have noticed if you are using an Apple device.

I would like to recommend 2 alternatives to VirtualBox which should solve this Issue for you. While one approach is a paid application, the recommended tool is completely free, but does come with a few restrictions compared to the fully supported Virtualbox toolchain.

Please be aware of the fact, you should be able to use those alternatives on Windows or Linux, too. But due to the fact that only macOS users are experiencing the described problem I am only going to explain the steps required to get it running there in detail.

VMWare Fusion

First, you will have to Download the Application from https://my.vmware.com/en/web/vmware/info/slug/desktop_end_user_computing/vmware_fusion/11_0 and install it as usual. You will be presented with the option to buy the tool or starting a 30 days free trial period.

After the installation is done, convert your VirtualBox Image to a format compatible to VMWare. To do so, Open the Menu File->Export Appliance from VirtualBox with the VM (named FreeRTOS_Sim) selected and choose Open Virtualization Format 1.0 (OVA) as output format. Save the file to an arbitrary location (you can remember).

From VMWare Fusion import the exported .ova file via File->Open. There might be some warnings you can ignore. Now, try to boot the VM. If there are errors, they might be gone if you try again.

After the boot process, make sure that the essential features like mouse/keyboard/internet connection do work before trying out the Emulator which should perform better now. Have fun using it!

Tipp: On Windows, you might look for a software called VMWare Player which should be completely free. Sadly it does not exist on macOS.

QEMU (free)

First, you have to install the QEMU virtualization software. I recommend to use the Homebrew package manager. If you have not used it before, run the following command from the Terminal application:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

If the installation was successful, simply run brew install qemu to install QEMU on your device. While the installation ist running (which might take some time) you should find out where the VDI disk image of your VirtualBox image is located. You can find it out using the Virtual Media Manager in VirtualBox or you might want to look for a folder called FreeRTOS_Sim_VirtualBox. Note down the full file path.

Create a directory to store your QEMU related files:

mkdir ~/QEMU/

Convert the VDI image to a RAW image using the VirtualBox command line utilities:

VBoxManage clonehd INSERT_PATH_TO_VDI_HERE ~/QEMU/FreeRTOS_Simulator-disk001.raw --format RAW

Convert the RAW disk image to a file compatible with QEMU:

qemu-img convert -f raw ~/QEMU/FreeRTOS_Simulator-disk001.raw -O qcow2 ~/QEMU/FreeRTOS_Simulator-disk001.qcow2

Create a script called run_image.sh inside ~/QEMU/ to have a shortcut to run the Image easily. Add the following contents:

qemu-system-x86_64 \
  -m 2048 \
  -smp 2 \
  -vga virtio \
  -show-cursor \
  -usb \
  -device usb-tablet \
  -enable-kvm \
  -drive file=/Users/INSERT_USERNAME_HERE/QEMU/FreeRTOS_Simulator-disk001.qcow2,if=virtio \
  -accel hvf \
  -cpu host

Please make sure to insert the File path notes before! To make the script executable, run cd ~/QEMU ; chmod +x run_image.sh. This should allow you to execute the script via a double click.

This should be it. If there are any issues, please report them f.e. by opening an issue.

Hint: To tune your performances depending on your hardware, you might want to adjust the amount out RAM (-m) and the number of CPU cores used by QEMU (-smp)!