virtually running rhel7 on a mac

January 16, 2016

I have a constant need to support Linux development. To address that need I’ve turned to virtual machines running on Windows or Mac OS X. For Windows I turn to VMware Player. On Mac OS X I have no practical choice other than VirtualBox from Oracle. In this post I talk about running CentOS 7.2 on VirtualBox 5.0.12.

The screen capture above is from my still-somewhat-new MBP. In order to create the screen shot I moved the mouse away from the VM and chord pressed [Command][Shift][4] and then pressed the space bar to bring up the camera mouse pointer. I then moved the camera back over the VM and clicked the trackpad to take capture.

In this basic example I’ve configured CentOS 7.2 with VBoxGuestAdditions 5.0.12, which you can download here: http://download.virtualbox.org/virtualbox You can download the VirtualBox installation package for your OS as well as the extension pack and guest additions. Note that the guest additions is an ISO that needs to be mounted in the VM before it can be installed inside the VM. You’ll need to install the guest additions if you want seamless mouse movement and sharing of host OS (Mac OS X in this instance) folders for transfer of data between guest and host.

My only big complaint with VirtualBox is networking. If you install with just NAT then the VM can reach outside of the host OS to the outside world and download updates when needed. Unfortunately the VM is unreachable from Mac OS. Any other type of networking attempting to combine both outside connectivity as well as internal is problematic. In particular, if I want to do development requiring network connectivity between my Mac and the guest OS then I can set up networking to do that, but at that point the VM can’t reach the outside world. The only example of what I’m trying to do was a howto for Windows 10 and VirtualBox, but that doesn’t work on my Mac.

The screenshot above shows the shared folders on the host OS. Make sure that the Linux account you’ve created on the VM has vboxsf as one of its groups or you won’t have permissions to see into the shared folders.

When you’re done with the VM just shut it down. If you opt to save the machine state, when you come back up the next time the mouse cursor will disappear when it moves over the VM desktop. Since my MBP has a SSD it’s just as fast for me to restart the VM as it is to save the state and restore, so to keep things as uncomplicated as possible I just turn the VM off when I’m done with a session. That way, the next time it’s powered up I know what the overall state is.

Update 17 January

I wrote about CentOS 7 back in September 2014, back when it was first released. Note that this is well over a year ago. I’d installed it on my notebook for a short period to compare it with Ubuntu and I discovered that it wasn’t quite up to my liking back then. But time and updates march on, and circumstances most definitely change. The changes to CentOS/RHEL as well as changing needs and requirements make that older review a bit OBE (overcome by events). I’m still no fan of the desktop look-and-feel but it’s not a deal-breaking issue, no more than it was over a year ago.