<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">You are correct, lunchVMPRocess() starts a front-end, so the Write lock (which is exclusive) is not owned by you, but by the process of the front end.<br>

</div><div class="gmail_default" style="font-family:verdana,sans-serif">Some settings can be changed during runtime, and you only need a Shared Lock for those (network interface attachment per exemple). Last time I asked the devs, there was no exhaustive list of the settings that can be changed with Shared lock. So you need to rely on the existing behaviour of the Virtualbox Manager to know.<br>

<br>Be aware that a bug exist that allow you to still save all the settings with the Java API (at least) : <a href="https://www.virtualbox.org/ticket/12164">https://www.virtualbox.org/ticket/12164</a> - so you can't just try & see which settings fails, they will all succeed.<br>

</div><div class="gmail_default" style="font-family:verdana,sans-serif">Writing your own front-end will not help because the limitation of changing the settings at runtime is because some are simply not taken into account until you start the VM, like the amount of CPU or the amount of RAM. Even if you wrote your own front-end and changed the values, they wouldn't be taken into account before a poweroff & poweron of the VM.<br>

I would not recommend writting your own front-end since you can use the Shared lock to save settings.<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 30 May 2014 11:59, Federica Renzi <span dir="ltr"><<a href="mailto:renzi.fede@gmail.com" target="_blank">renzi.fede@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Errata corrige: I use launchVMProcess() method to start up the machine with a frontend, so It will be that frontend the lock owner on machine, isn't it?</div>

<div> </div><div>Let me see if I completely understood:</div>
<div>The only way to change setting (and make them effective) during runtime is to have write lock on my machine and I can't do it starting up the machine using an existing frontend...right?</div><div>If it is correct, I will have to write my own frontend...</div>


<div><br></div><div>Sorry for these questions but I'm newbie and VirtualBox is...huge!:-)</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-30 9:07 GMT+02:00 Federica Renzi <span dir="ltr"><<a href="mailto:renzi.fede@gmail.com" target="_blank">renzi.fede@gmail.com</a>></span>:<div>

<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>thanks for your response!</div><div>Well...I tried to use LockType.Shared but It doesn't let me to save setting ( <font color="#ff0000">The function "saveSettings" returned an error condition: "The machine is not mutable (state is Running)"</font>) </div>



<div><br></div><div>Yes, The machine is running under my control (in theory), because I started it up using java Main Api. </div><div>I really would like to change some setting while it is running but I don't understand if it's possible.</div>



<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-29 22:07 GMT+02:00 Maxime Dor <span dir="ltr"><<a href="mailto:maxime.dor@altherian.org" target="_blank">maxime.dor@altherian.org</a>></span>:<div>


<div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Use LockType.Shared instead - some other process must already be using the VM (is it running?)</div>



</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>

On 29 May 2014 10:12, Federica Renzi <span dir="ltr"><<a href="mailto:renzi.fede@gmail.com" target="_blank">renzi.fede@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div><div>

<div dir="ltr">Hi everyone,<div>I'm trying to change some VM setting during the execution of virtualbox. I read in SDK documentation that it's possible only locking the machine and saving its state, otherwise no change will be performed.</div>







<div><br></div><div>I tried to achieve it using java api (com-xpcom glue) and custumize TestVBox.java, but I fall into these errors:</div><div><ul><li>if I write <br><font face="courier new, monospace">m.lockMachine(sess, LockType.fromValue(2)); // lock write</font><br>







<font color="#ff0000">The function "lockMachine" returned an error condition: "The machine 'NAME' is already locked for a session (or being unlocked)" (0x80bb0007)<br></font><br></li><li>if I write<br>







<font face="courier new, monospace">sess.unlockMachine(); </font><br><font color="#ff0000">The function "unlockMachine" returned an error condition: "The session is not locked (session state: Unlocked)" (0x8000ffff)</font><br>







<br></li><li>if I write directly (without any lock command)<br><font face="courier new, monospace">m.saveSettings(); </font><br><font color="#ff0000">The function "saveSettings" returned an error condition: "The machine is not mutable (state is Running)" (0x80bb0002)</font><br>







</li></ul><div><br></div><div>How could I solve it?</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thanks</span><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div>





<span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div>-- <br><div dir="ltr">Federica Renzi</div>
</font></span></div></div>
<br></div></div>_______________________________________________<br>
vbox-dev mailing list<br>
<a href="mailto:vbox-dev@virtualbox.org" target="_blank">vbox-dev@virtualbox.org</a><br>
<a href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" target="_blank">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Federica Renzi</div>
</font></span></div>
</blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Federica Renzi</div>
</font></span></div>
</blockquote></div><br></div>