[chris-allen-lane.com] Programming | Security | DIY

Connecting a Shapeoko 3 (GRBL 0.9) to VirtualBox

I recently purchased a Shapeoko 3, and am currently exploring options for my CNC workflow. Being averse to closed-source software like Carbide Create, today I spent some time configuring Universal G-code Sender as an alternative.

For reasons mostly related to Java dependencies, I decided to run Universal G-code Sender on a VirtualBox-based virtual-machine. Configuring the VM turned out to be non-trivial, so I'm documenting the process here. What follows are (a streamlined version of) the steps I took.

1. Create the Virtual-Machine

I used VirtualBox to create a virtual-machine based off of Lubuntu 15.10, and then installed the "VirtualBox 5.0.16 Oracle VM VirtualBox Extension Pack." (To the best of my understanding, the extension pack is required in order to give VirtualBox access to physical USB devices like the Shapeoko's serial-port.)

That process is straightforward and documented elsewhere, so I won't bother discussing it here.

2. Configure the Host system

I then made two necessary permission changes on my physical host:

sudo usermod -a -G dialout $USER
sudo usermod -a -G vboxusers $USER

Adding $USER to the dialout group gives $USER access to the Shapeoko's serial-port.

The second command may not be necessary on your system. My $USER was already a member of vboxusers. If yours isn't, be sure to make that change.

I also disabled hibernation on my physical host, in order to keep it from "falling asleep" while the Shapeoko runs long jobs.

Lastly, I rebooted the physical host. (I'm not sure why, but that seemed necessary in order to have the dialout change respected. I assume there exists a way around that reboot by restarting some specific service or something, but I didn't bother to figure it out.)

3. Configure the Guest system (within VirtualBox)

I then configured VirtualBox to make the Shapeoko's serial-port available to the guest machine:

Configuring the guest system

On my physical host, the Shapeoko's serial-port was mounted by default at /dev/ttyACM0. As best as I can tell, that is common.

4. Configure the Guest system (within the virtual-machine)

I then booted the virtual-machine and ran the following commands within:

This does a few things:

After the virtual-machine had rebooted, I disabled hibernation. I also installed the "VirtualBox Guest Additions" for convenience, though doing so is not required.

5. Configure Universal G-code Sender

Next, I configured Universal G-code Sender itself. There were only two required changes:

  1. Specify the serial-port location (mine was at /dev/ttyS0)
  2. Set the baud-rate to 115200 (assuming that your Shapeoko runs GRBL 0.9, which mine did out-of-the-box.)

Configuring Universal G-code Sender

Lastly, I ran ~/bin/start.sh to start Universal G-code Sender, and then executed a GRBL homing-cycle ($H) to confirm that I had a working machine.