[VirtualBox 6.1.16] : immutable machine ... kezako ?

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
didier.garcin
Posts: 2
Joined: 31. Oct 2020, 15:34
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: FreeBSD

[VirtualBox 6.1.16] : immutable machine ... kezako ?

Post by didier.garcin »

Hi everybody,

Code: Select all

                try
                {
                    machine.SetExtraData("VBoxInternal/DBGC/Enabled", "1" );
                    UpdateCurrentVM();
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

Code: Select all

machine.SetExtraData("VBoxInternal/DBGC/Enabled", "1" )
call raises an exception with ex.Message = "Cannot set extradata for an immutable machine"

I know VM storage medias may be immutable but mines are not. They are set to Normal.
But immutable machine, what's this ?
What I'm supposed to do ?

Thanks a lot by advance for your light.

Cheers

Didier.
Last edited by didier.garcin on 31. Oct 2020, 18:06, edited 1 time in total.
Martin
Volunteer
Posts: 2560
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: [VirtualBox 6.16] : immutable machine ... kezako ?

Post by Martin »

Was the VM running or in a saved state a this time?
didier.garcin
Posts: 2
Joined: 31. Oct 2020, 15:34
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: FreeBSD

Re: [VirtualBox 6.16] : immutable machine ... kezako ?

Post by didier.garcin »

It's totally off.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: [VirtualBox 6.1.16] : immutable machine ... kezako ?

Post by noteirak »

You need to get a session on the machine with the corresponding LockType (write in this case) and use the IMachine object on the iSession object.
IMachine objects returned by IVirtualBox itself are immutable. "Immutable" refers to the IMachine object itself, not the VM in VirtualBox.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply