I primarily use a Mac for my work, but since a I do a lot of robotics I have to switch over to Ubuntu to use ROS. Having a linux dual boot on a mac is doable and I have done it in the past (see instructions if you’re interested), but I just felt that giving up hard disk space for another operating system with a limited 512GB of storage is not something I wanted to do. Another issue is that the latest linux kernel doesn’t play well with the Macbook’s hardware, e.g., I could not get my machine to shutdown and it would get stuck which meant I would have to hard shutdown by keeping the power key pressed. That being said, I learned from a friend about the wonders of virtual machines, so here’s what I did.
Hardware: Macbook Pro Retina 15″ Mid 2015 (Model 11,5) running macOS Sierra. (I tried in El Capitan and it worked there as well).
Ubuntu Version: Lubuntu 14.04.5 (Lubuntu has all the goodness of ubuntu without the heavy add ons, good for virtual machines where you want to minimize resource consumption).
ROS Version: Jade
- Download and install VMWare Fusion (8.5 is what I’m using), I know of another virtualization option called Parallels but that is known to be more expensive than fusion in the long-term. Though if you’re a student you can get student pricing. There is a third option called Virtualbox which is free but its more difficult to setup and has known issues with 3D acceleration which may make using Gazebo problematic.
- Get Lubuntu 14.04 from here. I used Lubuntu because it is a lighter flavor of ubuntu with all the goodness and none of the more fancy stuff (bells and whistles). Its a pretty solid distro for ROS use and gets the job done. On a virtual machine you wanna consume less resources unless absolutely necessary so that you don’t slow down your host machine / os.
- Start up Fusion and choose the option “Install from disc or image”. Then follow the instructions and use the downloaded Lubuntu iso file.
- You will be able to choose the resources that you want to dedicate to your VM, here are my choices:
- Enable 3D acceleration in the Displays setting.
- I dedicated 4 cores from the 8 cores that I have available.
- 8 gb of RAM which is 50% of what I have available.
- 1024 MB of graphics memory.
- 40GB of hard disk space. Fusion will automatically choose swap size.
- I know this is all too generous, but what the heck, I want to run gazebo sims smoothly.
- Now let vmware do the rest.
- Now startup the virtual machine (vm) then in your bash rc file in Lubuntu, add the following line:
- Follow ROS installation instructions and that’s it, you’re all set to go and run crazy ROS sims.