Programming mentor here. I have a Mac and one of the frustrations I have is relying on student or team Windows laptops to run the Drivers Station code. I really don’t want to buy a second windows laptop and lug around two laptops to team meetings and events (may they both restart soon). So this week I invested some effort into setting up a a Windows 10 VirtualBox instance on my mac. I got all the software installed and running.
However, my challenge now is getting a network connection from the virtualbox running windows to the Roborio. I need to either route traffic to our 10.29.30.0/24 network (we’re team 2930 the Sonic Squirrels) through my Mac OR add a second network connection in Windows that routes 10.29.30.0/24 traffic to the Roborio and everything else out to my Mac. So far I haven’t gotten either to work. I did manage to get routing set up on the Mac. I could ping the roborio and hosts on the internet.
I have limited experience with VirtualBox, but from my reading it seems like the only network setting that has a chance of working is the “bridged” mode. (see https://www.virtualbox.org/manual/ch06.html#networkingmodes) I didn’t find any technical details of how this works, except some statement about how VirtualBox injects it’s outbound traffic into the host machine’s (my Mac’s) TCP stack using the host machines MAC address, but with the VirtualBox’s IP address. It seems like this bypasses the routing tables on my Macbook so I have not been able to redirect 10.29.30.0/24 traffic to the correct interface. Instead it just get’s dumped onto the default network interface.
Note: maybe Host-only networking mode might work? It all depends on how VirtualBox interfaces interact with the routing tables.
The other approach I tried was to use the USB cable direct connect to the Roborio and assign that USB device to the Windows VirtualBox. The USB connection (it behaves as a ethernet adapter) shows up on Windows, yet VSCode and the Driver station can’t find it. Looking at the Windows Device Manager, it shows the device as having a config error preventing it from being configured.
One silver lining is figuring out that I can manipulate the routing table on my Mac so that I can simultaneously connect to the Internet AND the roborio via a USB or ethernet connection. All I had to do was delete the “default” route that was sending all traffic to the robot’s network. This is super useful when you’re trying to google error messages and push code to the robot without having to constantly switching between wifi networks. Next I’m going to try this using an external USB Wifi adapter and join two wifi’s at once (the Internet and the robot).
My next desperate act will be to set up a raspberry pi as a router that is connected to the wifi and the robot. Maybe I can route 10.29.30.0/24 traffic through my mac to an external router?
And before you suggest dual booting my Mac, I’d rather not have to shutdown MacOS every time I want to run the driver station, Ior the other hassles of reinstalling the OS, lose my 50 open tabs, close email, etc.
Surely I’m not the only one?