Use of VHD from a Shared Folder

This is for discussing general topics about how to use VirtualBox.
Post Reply
Krisow
Posts: 23
Joined: 3. Nov 2020, 05:28

Use of VHD from a Shared Folder

Post by Krisow »

I'm using VirtualBox on my Laptop and I had the VHD file for my virtual machine on the laptop, but I now have a server with much more storage then my laptop so I copied the VHD file to a shared folder on my server and then disconnected the old vhd to the new vhd's placement on the shared folder on my virtual machine. Problem is when I try to boot/start the virtual machine now it just gives me an error and says something about ¨image_read_only¨, what have I done wrong? and what do I need to do for it to work?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Use of VHD from a Shared Folder

Post by mpack »

VHD was a bad (corruption prone) choice to begin with, add a slow and potentially unreliable shared folder connection and I would not say this was a recipe for future happiness.

Also, when you say that you located the VHD over there, I hope you mean that you located the entire VM over there, since moving selected VM files outside of the VM folder is not recommended practice, as it complicates backup procedures (and you should definitely investigate how to make backups and restore from them).

As to the error, you have not reported the precise wording, but I'm going to guess that your current login doesn't have write permission in that (NAS?) folder. It's a common enough error when setting up a new NAS.
Krisow
Posts: 23
Joined: 3. Nov 2020, 05:28

Re: Use of VHD from a Shared Folder

Post by Krisow »

I have copied the VHD itself and the virtual machine folder to one shared folder on the server.

https://i.imgur.com/4RiA1gZ.png
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Use of VHD from a Shared Folder

Post by BillG »

That message would confirm what mpack already told you - it is a Windows permissions problem.
Bill
Krisow
Posts: 23
Joined: 3. Nov 2020, 05:28

Re: Use of VHD from a Shared Folder

Post by Krisow »

BillG wrote:That message would confirm what mpack already told you - it is a Windows permissions problem.
I don't understand why, when I shared the folder from the server I gave full Write, Read etc. Access to anyone who connects to the folder with username and password. Don't know why Virtualbox would have Permission/Writing issues.
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Use of VHD from a Shared Folder

Post by BillG »

I can't help you. I would never even consider running a vm from a network share, so I have never been there.
Bill
Krisow
Posts: 23
Joined: 3. Nov 2020, 05:28

Re: Use of VHD from a Shared Folder

Post by Krisow »

BillG wrote:I can't help you. I would never even consider running a vm from a network share, so I have never been there.
The reason why I'm trying to have the VHD on a shared folder is because have 8TB storage space on my Server and only 1TB on my laptop, but my server isn't strong enough to use Virtual Machines on it as its just a storage server while my laptop can run up til 2 Virtual machines at once, but only has 1TB while the VHD is at 500GB. Have tried to minimize the size of the VHD to 250GB, but it doesn't seem to work even if I've cut the size down to 250GB in the VM itself through Disk Management and then through the Media Manager on VirtualBox and even tried with CMD commands and PowerShell. Thats why I'm trying to use a VM on my laptop with a the VHD from a shared folder on my server, my internet goes 120mbps so it should work fine. The problem that I can't seem to get my head around or solve is that VirtualBox is having a ¨Read Only/Permission¨ Issue that I can't understand as to why it does.
Krisow
Posts: 23
Joined: 3. Nov 2020, 05:28

Re: Use of VHD from a Shared Folder

Post by Krisow »

Also saw that VHD wasn't recommended, is VDI the better option? I learned about Virtual Machines back in 2017 when my teacher recommended VHD so I haven't tried the other options like VDI etc. yet, just used VHD because I'm used to it.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Use of VHD from a Shared Folder

Post by scottgus1 »

If you can use your logged-on account on the host PC to open Notepad and save a new file into that shared folder, close it, re-open it and edit it and save it again, then the account has write permissions to that folder. As long as you open the Virtualbox VM with the logged-on account, which means typical methods like clicking the guest and clicking Start, double-clicking the guest, etc, not doing weird things with getting the guest to start under another account, then Virtualbox should also have write permissions to the shared folder. The host OS handles permissions, not Virtualbox.

Please use Upload Attachment to post images, not 3rd-party websites. Crop & resize to get under the forum's 128kB size limit.

Virtual disks can come in two types: fixed and dynamic. Fixed builds a full-size disk file taking up the entire final size of the disk from the very start, before any data gets written into it. Dynamic starts off with a very tiny header file and gets bigger as more data gets written in. Dynamic VHD has a design flaw that can kill the VHD if the host PC has a disk error while the VHD size is getting increased. While fixed VHD probably has the same design, it does not get bigger, so the failure situation does not occur.

If you must use VHD, and they are handy for being able to mount the virtual disk file as writable on a Windows host while the VM is shut down, use fixed VHD. Virtualbox is compatible with VHD, but VDI is of course grokked better. Fixed disk files of any format can't be resized, you can only clone them to an alternate larger disk.

I have not tried over-network disk access for a complete OS. Even with gigabit Ethernet it will be slower. Now if you have 40Gbps fiber to that laptop, well then.... :lol: A larger built-in host disk or rethinking the required guest disk size seems a better solution to me.
arQon
Posts: 231
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: Use of VHD from a Shared Folder

Post by arQon »

scottgus1 wrote:I have not tried over-network disk access for a complete OS. Even with gigabit Ethernet it will be slower. Now if you have 40Gbps fiber to that laptop, well then.... :lol: A larger built-in host disk or rethinking the required guest disk size seems a better solution to me.
yknow, it COULD actually be close in some case: 100MB/s out of the NAS, vs the random IOP performance of a 2.5" 5400RPM laptop drive? On a Windows host (especially), I could be tempted to take that bet. :)
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Use of VHD from a Shared Folder

Post by fth0 »

IMHO, the (bulk) data transfer rate doesn't play a big role, the delay or round trip time of the access to a single disk sector (or cluster) is more important, and also caching. It would be interesting to compare a NAS with SSDs to a local SSD, possibly using iSCSI. Since I started using SSDs, I would never use a HDD for hosting the virtual hard disk drive again. ;)
Krisow
Posts: 23
Joined: 3. Nov 2020, 05:28

Re: Use of VHD from a Shared Folder

Post by Krisow »

scottgus1 wrote:A larger built-in host disk or rethinking the required guest disk size seems a better solution to me.
Alright then, so I shall then try to make an IMG of the VHD and make it into a smaller sized VHD (Fixed) or VDI. Gonna research a little on the benefits and comparisons there. Thanks for the help
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Use of VHD from a Shared Folder

Post by scottgus1 »

VHD can still be used, as long as it's fixed. If mounting the drive on the Windows host is not something you intended, go to dynamic VDI.

The easiest way to go to dynamic VDI is with Mpack's CloneVDI.

If you want to stick with a smaller VHD, make a new fixed VHD of the desired final size, mount both VHDs to the Windows host, then use free Macrium Reflect to clone old to new with partition size adjustment.
Post Reply