I have a directory on a system which is the host for a virtual machine. I want to make this directory accessible from the guest of the virtual machine.

There are some way I can think of, packing the directory to iso or img file which means make a copy of the directory, not the directory itself. For virtualbox, there's shared folder method which I have to install guest additions to the guest machine. That's not what I need because I want to mount the directory when installing Arch Linux on a new virtual machine.

I can't find a way for Qemu too. Then I wondering, is it even possible? If it is, how to do that?

My goal is to do something like:

mount /dev/sdb /mnt

inside the guest machine, but instead of /dev/sdb, somehow pass a directory of the host machine.

More specifically, I've backed up all of packages that pacman has downloaded to a directory in host machine. And I want to mount that directory to /var/cache/pacman/pkg so I don't need to download the package everytime I install Arch Linux. I'm doing Arch installations often for testing purposes.

  • This is very unclear (to me). What are you actually trying to do? Can you provide an example? – roaima Apr 26 '15 at 13:16
  • @roaima Updated. That's the specific goal. – Mas Bagol Apr 26 '15 at 13:29

This can be easily done by using NFS. You'll have to install a NSF server on your host (very easy) and then mount the directory on the guest. https://wiki.archlinux.org/index.php/NFS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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