After some trial and error I figured out how to get ursim to run on Windows 10. I thought I would share the instructions I typed up in case it helps someone else out in the future. I have only tested this on one machine so far so your mileage may vary…
Install the Windows Subsystem for Linux
In my case I had to manually install the Ubuntu 16.04 distro because the windows store was not working on my pc which appears to be a common issue. I originally tried using Ubuntu 18 but it failed. Just for clarity, I determined which Ubuntu version to use by downloading the entire starter package, running the virtual machine in VMWare player and at the bash prompt I used the command:
‘lsb_release -a’
I discovered that the VM image was using Ubuntu 16.04. I have a hunch that the URControl binary file was compiled using the gcc version common for the 16.04 release. Therefore, to make things compatible you will also want to use 16.04. However, in the future when the URSim is updated, you may have be required to upgrade to a newer version. You can always check which version to use by running the command above. Hopefully by that time someone at universal robots will read my crazy instructions and officially support running ursim on windows.
To manually install, I downloaded the appx file for 16.04, rename the file extension to zip. Extract it to a temp folder using 7-Zip or another tool of your choice. Then open and administrative command prompt and run ubuntu.exe. It will take a few minutes to install.
To make things easy, during the install you should assign the default username to “ur” and use the password “easybot”. This will create your home directory so it matches the folder structure in the VMWare image provided by UR. If you choose a different username then you can still use the linux adduser command to create the “ur” user. However, when you compile with maven or run the simulator you will probably want to use the “su ur” command to login to the “ur” account.
Install Xming Server for Windows
After install finished run the program, it will run minimized in your system tray
Upgrade Ubuntu packages
Open a command prompt, then type bash. You should now be running your Ubuntu distro. Now enter the following commands to apply the updates to your Ubuntu install. This will probably take a few minutes because there are a lot of packages to update.
sudo apt update
sudo apt upgrade
Manually Install Required Packages
Download URSim 5.2: URSim. Using 7-zip or another extraction tool of your choice, decompress the files into the /home/ur/ursim directory. Using your bash prompt run the install.sh using the following command.
./install.sh
In my case, the install script returned a few errors and ultimately failed, but not before it installed quite a few dependencies such as java. To finish the install process you will now need to run these additional commands:
sudo apt install lib32gcc1 lib32stdc++6 libc6-i386
sudo apt install libcurl3 libjava3d-* ttf-dejavu* fonts-ipafont fonts-baekmuk fonts-nanum fonts-arphic-uming fonts-arphic-ukai
cd ursim-dependencies
sudo dpkg -i curl-dev-ur_7.18.2-1_amd64.deb
sudo dpkg -i libxmlrpc-c-ur_1.33.14_amd64.deb
sudo dpkg -i libxmlrpc-c-dev-ur_1.33.14_amd64.deb
Install QEMU BinFormat Support
The URControl binary executable does not run by default in WSL. In order to make it work you have to install QEMU Binary Format Support. Thankfully someone else figured this out because I never would have found this one on my own:
https://github.com/microsoft/wsl/issues/2468#issuecomment-374904520
sudo apt install qemu-user-static
sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'
You will need to reactivate binfmt support every time you start WSL. To simplify this process, I created a .bashrc file in the ur home directory so this happens automatically everytime I login. I also export the DISPLAY variable so my screen is pushed to the Xming window.
sudo service binfmt-support start
export DISPLAY=:0
To start the simulator, navigate to the ~/ursim folder and run the command
./start-ursim
If all goes well, the Xming window should appear.
URCap Development
I use Visual Studio Code with the Maven for Java extension to develop the UR Caps.
If you open a terminal in VS Code, you can access the command prompt and type “bash” to enter your Ubuntu shell. I installed maven 3 using “sudo apt install maven” and I copied the .m2 folder in the UR home directory from the Starter kit. The .m2 folder contains the jar files required for the UR api.
You will need a copy of the sdk folder from the VMWare image in the ur home directory. Run the install.sh script from this folder.
To compile your code use the bash prompt in the terminal window and type “mvn install -P ursim”. To run the simulator type “~/ursim/ursim-5.2.0.61336/start-ursim.sh”.