Can't assigne writethrough type to vdi disk

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Highlander9
Posts: 5
Joined: 2. Feb 2016, 15:42

Can't assigne writethrough type to vdi disk

Post by Highlander9 »

Good day!
Centos 6.7 X64
Kernel 573.12.1.el6.x86_64
VirtualBox 5.0.14

I tryed to chanhe medium type from Normal to Writethrough

Code: Select all

vboxmanage modifymedium Conference3.vdi --type writethrough
The result of

Code: Select all

vboxmanage showmediuminfo Conference3.vdi
is:

Code: Select all

UUID:           700440cc-7c60-4b1f-83db-f4f7287172c0
Parent UUID:    base
State:          created
Type:           writethrough
Location:       /data/D/Virtualbox/VMS/Office/Conference/Conference3.vdi
Storage format: VDI
Format variant: fixed default
Capacity:       2048 MBytes
Size on disk:   2050 MBytes
Encryption:     disabled
Note! - Type: writethrough

In a 1 minute the same comande

Code: Select all

vboxmanage showmediuminfo Conference3.vdi
shows:

Code: Select all

UUID:           700440cc-7c60-4b1f-83db-f4f7287172c0
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /data/D/Virtualbox/VMS/Office/Conference/Conference3.vdi
Storage format: VDI
Format variant: fixed default
Capacity:       2048 MBytes
Size on disk:   2050 MBytes
Encryption:     disabled
Type is changed to normal(base)
Could you help me to resilve the problem?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't assigne writethrough type to vdi disk

Post by Perryg »

You probably should read the users manual for VBoxManage. http://www.virtualbox.org/manual/ch08.html

Using undocumented commands may or may not work but only the documented commands are really supported.
Highlander9
Posts: 5
Joined: 2. Feb 2016, 15:42

Re: Can't assigne writethrough type to vdi disk

Post by Highlander9 »

I use appropriate commands

Code: Select all

vboxmanage modifymedium
Usage:

VBoxManage modifymedium     [disk|dvd|floppy] <uuid|filename>
                            [--type normal|writethrough|immutable|shareable|
                                    readonly|multiattach]
                            [--autoreset on|off]
                            [--property <name=[value]>]
                            [--compact]
                            [--resize <megabytes>|--resizebyte <bytes>]
Highlander9
Posts: 5
Joined: 2. Feb 2016, 15:42

Re: Can't assigne writethrough type to vdi disk

Post by Highlander9 »

Perryg wrote:You probably should read the users manual for VBoxManage.

Using undocumented commands may or may not work but only the documented commands are really supported.
VBoxManage modifyhd Conference3.vdi --type writethrough
The same problem
The type of modified hd has been changed to normal (base) in a minute
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't assigne writethrough type to vdi disk

Post by Perryg »

Post the guests log file ( as an attachment ). Right click on the guest in the Main Manager then click show log. Save and post as an attachment. Compress if it is too large to post.
klaus
Oracle Corporation
Posts: 1335
Joined: 10. May 2007, 14:57

Re: Can't assigne writethrough type to vdi disk

Post by klaus »

This is no bug, but on the other side I can understand why users would consider this confusing. Taking a deep breath...

First of all, the medium type (normal, writehrough, ...) is stored in the medium registry, not in the .vdi image.

You are using a .vdi image which isn't in use by any VM, which means that it ends up in a temporary, in-memory medium registry which gets lost when VBoxSVC (the service which implements the API) terminates. This termination happens 5 seconds after the last API client terminated. Not a lot of time for typing commands, but I guess you used the command history to get the "vboxmanage showmediuminfo" command submitted in time (or had some other API client like the GUI or a VM running which terminated eventually).

This explains why you get this "now it's there, now it isn't" behavior.

As soon as you associate a medium with a VM, it shows up in the VM's medium registry and that allows making it persistent. I would recommend changing the order: first associate the disk image with a VM and then change the medium type to writethrough. This way it's guaranteed to work, without having to type commands at super-human speeds. If you use the GUI these quirks wouldn't be visible as it's a single, long-running API client, unlike VBoxManage which goes away after every command.

BTW, you're right. This is a documented command. No idea right now why Perryg thought otherwise.
klaus
Oracle Corporation
Posts: 1335
Joined: 10. May 2007, 14:57

Re: Can't assigne writethrough type to vdi disk

Post by klaus »

Perryg wrote:Post the guests log file ( as an attachment ). Right click on the guest in the Main Manager then click show log. Save and post as an attachment. Compress if it is too large to post.
Perryg, don't know what or why, but you appear to be off the track in this case. There is no guest related to these commands (not even a non-running VM) and therefore getting VBox.log isn't getting us anywhere. VBoxSVC.log would be the right log file, but it isn't providing clear hints either, because one would need to derive the "data loss" from the fact that VBoxSVC gets terminated/restarted.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't assigne writethrough type to vdi disk

Post by Perryg »

Would you be so kind to point me to the "VBoxManage modifymedium" in the users manual? I don't see it and the reason I said what I said. It does exist in the CLI help but without knowing the users experience level it is ( in my opinion ) better to stick with the users manual. ( IIRC modifymedium was deprecated with modifyhd ) but as old as I am I am probably wrong.

As to why the guest log file it is to see what the type of VirtualBox is being used. Repo vs. official.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Can't assigne writethrough type to vdi disk

Post by mpack »

klaus wrote:There is no guest related to these commands (not even a non-running VM)
Would you mind explaining what tells you that? I've gone over what the OP said, and to me this VDI looks like it's part of a VM called "Conference". Yes, the VMs are not in the default folder, but has has a VMs container folder, and a VM folder.
klaus
Oracle Corporation
Posts: 1335
Joined: 10. May 2007, 14:57

Re: Can't assigne writethrough type to vdi disk

Post by klaus »

It's very subtle. Yes, I guess you're right that most likely these images are meant to be used in the context of some VM, but the VBoxManage output which Highlander9 provided gives clear evidence that the images are not currently associated with a VM.

Try "showmediuminfo" yourself with some disk images which are associated with a VM and some which you have lying around. The output always contains a line "In use by VMs" for media associated with one or more VMs, which isn't there if there is no VM association at all. Now reread the original message.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Can't assigne writethrough type to vdi disk

Post by mpack »

I see, thanks.
Highlander9
Posts: 5
Joined: 2. Feb 2016, 15:42

Re: Can't assigne writethrough type to vdi disk

Post by Highlander9 »

I used phpvirtualbox
Storage configuration

Code: Select all

Controller SATA
SATA Port 0: Windows7U32.vdi (Normal, 14.65 Gb)
SATA Port 1: [Optical Drive] Empty
SATA Port 2: Conference3.vdi (Writethrough, 2GB)   !!!
The --type Writethrough works if the VM (Conference) is powered off. I mean if I take the snapshot (of the VM) the Conference3.vdi won't be snapshotted.
If the VM runs, the new snapshot will be taken with the Conference3.vdi included in.

PS:
Phpvirtualbox shows that Conference3.vdi has 'Writethrough' type but linux console shows 'normal' type for the vdi.
klaus
Oracle Corporation
Posts: 1335
Joined: 10. May 2007, 14:57

Re: Can't assigne writethrough type to vdi disk

Post by klaus »

I would be worried if phpvirtualbox and VBoxManage disagree on the state of affairs. Are you using the two clients as a different user?
Highlander9
Posts: 5
Joined: 2. Feb 2016, 15:42

Re: Can't assigne writethrough type to vdi disk

Post by Highlander9 »

klaus wrote:I would be worried if phpvirtualbox and VBoxManage disagree on the state of affairs. Are you using the two clients as a different user?
Thank you Klaus! I've understood )
Phpvirtualbox works through vboxuser (the user included in vboxusers's group). The type of Conference3.vdi is correct - Writethrough if I see the vdi in console under vboxuser.
Post Reply