So my RPI is working great and is running it's OS from the SD card. A lot of the time when I'm programming I don't have an internet connection. I can't make a direct connection to my mac cause it's a Macbook Air and it doesn't have Ethernet. So what I would like to be able to do is the following:

When I eject the SD from the Pi and connect the SD to my mac I see the following files:


Is there a way to edit the root files from my Mac when the SD is plugged into my Mac? (By saying the root files is mean the files you see when you ssh into the pi with the SD in and enter the command cd / )

  • how do you ssh into your pi? with your wireless router's ethernet port?
    – Gotschi
    Commented Feb 15, 2014 at 13:42
  • Yes, when i have wifi at home i do it that way.
    – eds1999
    Commented Feb 15, 2014 at 13:51

2 Answers 2


Due to the way the SD-card reader is connected in Macbooks, you can't mount the root Filesystem on Partition 2 of the card which is formatted in EXT (no virtual machine or other Programm will be able to access the SD-reader in OSX). The first partition is FAT32, which is automatically mounted by OSX and shows up in Finder.

You can only boot native to Ubuntu or any other Linux distro and mount the SD card there

you can make a backup (.img) of your SD-Card and mount this in a virtual machine. This workaround is also not the simplest and pretty slow (depending on the sd card)

  • Thanks for the quick response! Well i can make my Mac boot from Ubuntu. Would it work that way? (And just for information, would it be possible to mount EXT under Windows on a PC?) I'm pretty good at programming but not with partitions and hardware stuff..
    – eds1999
    Commented Feb 15, 2014 at 13:53
  • You can definitely access it from Ubuntu. I have not heard of anyone doing it from Windows, although you might be able to if you find a utility or (better yet) driver for ext4 filesystems. ext2/3/4 is open source, but Apple and MS are adverse to implementing it themselves for whatever reason.
    – goldilocks
    Commented Feb 15, 2014 at 13:59
  • Thanks for your help, it made things a lot easier! Just another little question: Is there a way to make the Pi access the boot partition, so when the Pi boots up it runs a python script in the boot partition? That way i would be able to edit it on my Mac, which would be fantastic.
    – eds1999
    Commented Feb 16, 2014 at 21:42
  • Can you explain how would you mount the .img of the SD Card onto the virtual machine? Commented May 8, 2017 at 16:43

I basically didn't have a Keyboard I could use for my Raspberry Pi and was wanting to do the same.

I did this:

  1. Insert the SD card into the MacBook
  2. Open Applications > Disk Utility > right click on the partition under "Apple SDXC Reader Media" > unmount
  3. Take a note of the "Device" name on "Apple SDXC Reader Media" mine was disk3
  4. Install Virtual Box
  5. Run this command changing "disk3" at the end to what you got in step 3 sudo VBoxManage internalcommands createrawvmdk -filename ./sd-card.vmdk -rawdisk /dev/disk3
  6. Change the permissions so you can access them sudo chmod 777 /dev/disk3 sudo chmod 777 ./sd-card.vmdk
  7. Download the Ubuntu live iso from here (You can use your own favorite distro if you want.)
  8. Create a Virtual Machine in VirtualBox enter image description here
  9. Dont set a hard disk on this step: enter image description here
  10. Once the virtual machine is created go to > Settings > Storage > Add the Ubuntu live iso as the live CD like this: enter image description here
  11. Add a SATA controller and set the hard drive to the file you create in step 5 "sd-card.vmdk" like this:

Note I had to unmount the partition again here like in step 2, it was some how mounted. enter image description here 12. Run the Virtual Machine and you should see the mounted sdcard partitions (boot and the 32GB partition in my case) now you can edit the files you need. enter image description here

  • Excellent solution! This helped me out when I created a duff file in /etc/sudoers.d. A couple of minor differences/issues I encountered: I found the partition was named "root" in Ubuntu. Also, running the Live CD was extremely slow and unstable unless I increased the RAM from 1024 to 2048. Finally, to remove the erroneous file under /etc/sudoers.d, I needed to be root. Easiest way to do this (IMO) is to open a terminal, "sudo su -" and navigate to (in my case) /media/root/etc/sudoers.d
    – RCross
    Commented Jun 1, 2018 at 12:07
  • For ubuntu, select try ubuntu, also had to mount using disks inside ubuntu, and then go to the folder linked from there /media/ubuntu/... Commented Jan 29 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.