Can a host be given read access to files inside a guest?

This is for discussing general topics about how to use VirtualBox.
Post Reply
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

Can a host be given read access to files inside a guest?

Post by appyface »

I have a guest that is wholly contained, it has no shares or any kind of write except to it's own hard disk (VDI file). I would like for the host to be able to read the filesystem inside the guest, and copy out designated files. Is this possible?

I have been searching here for info but can't seem to find the right words or phrases -- the only posts I have found so far, tell of giving the guest write access to shares on the host machine. Please do point me to documentation, posts, etc. if I missed finding them in my searches, thank you.

I did find one reference on the 'net that sounded like what I want to do, it uses a networking bridge created between the host and the guest. I'm not familiar with this concept and I did not get a clear picture if that will do what I want -- give the host read access to the guest's filesystem -- without allowing the guest to write outside the VDI.

Thanks and regards,
--appyface
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Can a host be given read access to files inside a guest?

Post by Sasquatch »

Add a Host-Only NIC to the VM and share the whole virtual drive from within the VM. You can then mount that share in the Host.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

Re: Can a host be given read access to files inside a guest?

Post by appyface »

You're kidding, it's that easy? I did not find this, so sorry. Thank you I will give this try.

Best regards,
--appyface
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Can a host be given read access to files inside a guest?

Post by Sasquatch »

appyface wrote:You're kidding, it's that easy? I did not find this, so sorry. Thank you I will give this try.

Best regards,
--appyface
You really didn't think about the easiest solution? :lol: :lol:
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

Re: Can a host be given read access to files inside a guest?

Post by appyface »

:shock:

j/k :P

Unfortunately I'm brand new to Vbox and VM's. So I not only had no idea what this would be called or how it would work, I didn't even know if it *could* work. When you're starting out that far below ground-zero, there aren't a lot of concepts formed yet :lol:

Thanks again for the help,
--appyface
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

Re: Can a host be given read access to files inside a guest?

Post by appyface »

Step one accomplished in seconds -- the host-only adaptor is working on the guest.

Step two -- share the guest filesystem -- I am completely stuck here.

My guest is Linux Mint 7 Gloria Universal. Unfortunately I am also a complete n00b to linux not just VBox.

I've been searching the Linux Mint forums and the 'net at large for the better part of the day and have found -zilch-. I'll go post in the Linux Mint forums for help now. If anyone can throw me a post or webpage that tells me what I need to look at/do, please let me know. I realize this has nothing to do with VBox but perhaps someone here just happens to know what I need to do :)

Kind regards,
--appyface
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Can a host be given read access to files inside a guest?

Post by Sasquatch »

Search for a howto about Samba. That package allows *NIX systems to share files on a Windows network. It's highly configurable, most of that is explained in the howto's. http://ubuntuforums.org/showthread.php? ... amba+howto for example is quite helpful.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

Re: Can a host be given read access to files inside a guest?

Post by appyface »

Thanks again, Sasquatch... off to have a look now.

Kind regards,
--appyface
NeBlackCat
Posts: 154
Joined: 3. Aug 2008, 13:37

Re: Can a host be given read access to files inside a guest?

Post by NeBlackCat »

If it's just something you want to do occasionally in an offline sort of way, you could also use imdisk (Windows host, with ext2/3 support installed) or mount_vdi (Linux host) to mount and directly access the guest's (static) virtual disk from the host.

Downside is that you have to stop your VM, upside is that it's way faster than, and doesn't require, virtual networking.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Can a host be given read access to files inside a guest?

Post by Sasquatch »

May be, but I find the ext2/3 driver for Windows very unstable and has caused data loss for me at least once (and I used it three, four times max).
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

Re: Can a host be given read access to files inside a guest?

Post by appyface »

@NeBlackCat - That is an interesting idea! I hadn't thought about 'mounting' a VDI as one would do, say, an ISO (at least, I think conceptually that's what you're suggesting, mount it and read what's inside it).

@Sasquatch - Stability issues would definitely be a concern for me. And I am planning for the VM to be up all of the time unless there is a specific reason to take it down. Nonetheless, I do like both ideas and will look into them further, they could both be quite useful.

Thank you both for your suggestions and valueable insights.
Kind regards,
--appyface
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Can a host be given read access to files inside a guest?

Post by Sasquatch »

As long as you only copy files from the VDI to the Host system, and not write into the VDI, you should be a big step away from corruption, but it's always possible. The VDI should be mounted as read-only to avoid any chance of corruption (maybe the tool already does that).
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
appyface
Posts: 79
Joined: 13. Sep 2009, 21:31
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP W7 Linux

Re: Can a host be given read access to files inside a guest?

Post by appyface »

Thanks Sasquatch, very good point. I already have and use imdisk on my windows host for ISO, which I mount read-only. I'm sure I didn't install the ex2/ex3 support as NeBLackCat mentions (having not needed this before), so I'll be finding out if those drivers cause me any problems. While I do have long-term goals for Mint-in-a-VM, the good news is I'm still learning at this point -- so trying out all the options is all good.

I do have a heavy load at work right now so will have to put this down for a couple weeks :( Just when it is getting interesting! So it won't be right away, but I will be back to post what happened to me :lol:

Kind regards,
--appyface
NeBlackCat
Posts: 154
Joined: 3. Aug 2008, 13:37

Re: Can a host be given read access to files inside a guest?

Post by NeBlackCat »

I've used the ext2/ext3 IFS for some time now, it doesn't cause any instability on my system and seems to be bulletproof for reading Linux partitions. I don't know about writing them extensively, but the occasional writing that I do hasnt yet corrupted anything.

Nice to have both options, anyway.
Post Reply