loopback devices based on files in shared folder

Discussions about using Linux guests in VirtualBox.
Post Reply
mannyk
Posts: 5
Joined: 4. Dec 2013, 21:58

loopback devices based on files in shared folder

Post by mannyk »

I tried to make a loopback device based on a file in a shared folder. The loopback device
doesn't work, it doesn't provide block device access to more than a bit of the beginning of the file.
Has anyone tried this?

For example, in a shared directory on the guest I tried the following

Code: Select all

truncate -s 1M test1m.img
losetup -f --show test1m.img 
  # /dev/loop0
hexdump -C test1m.img | less 
   # Only shows a line or two before getting to an apparent end. Attempts to use
   # this as a block device have failed for me so far
Is 'losetup' supposed to be supported for files in shared folders?

Guest: linux, debina wheezy. Host OS X.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: loopback devices based on files in shared folder

Post by noteirak »

Shared folders are not proper file implementations. Rather, they are the minimum needed to emulate it. Don't expect any advanced stuff to work with them.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
8ohmh
Posts: 3
Joined: 23. Feb 2016, 01:16

Re: loopback devices based on files in shared folder

Post by 8ohmh »

Hello,
I've the same problem. So far the current only solution is to copy back the file to your guest, edit it or whatever and copy back to host shared (rsync)

BTW:

Hey Guys (@Oracle), here why don't you put a build environment-VM for building the VirtualBox (look at https://developer.mozilla.org/en-US/doc ... ing_the_VM)
Post Reply