<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hps
        {mso-style-name:hps;}
span.shorttext
        {mso-style-name:short_text;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I believe that the reason the machine is locked is because you are already locking it at <o:p></o:p></span></p><p class=MsoNormal><i><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:gray'>"</span></i><i><span style='color:gray'> <span lang=EN>IProgress progress = machine.launchVMProcess(session, "gui", "");"<o:p></o:p></span></span></i></p><p class=MsoNormal><i><span lang=EN style='color:gray'><o:p> </o:p></span></i></p><p class=MsoNormal><i><span lang=EN style='color:gray'><o:p> </o:p></span></i></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Please refer to the SDK ref for more information.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Danny.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> vbox-dev-bounces@virtualbox.org [mailto:vbox-dev-bounces@virtualbox.org] <b>On Behalf Of </b>Rafael Braga<br><b>Sent:</b> Thursday, September 01, 2011 21:49<br><b>To:</b> vbox-dev@virtualbox.org<br><b>Subject:</b> [vbox-dev] The given session is busy<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'><span class=hps><span lang=EN>Hello,</span></span><span lang=EN> <span class=hps>I am</span> <span class=hps>beginner</span> <span class=hps>in virtualbox</span> <span class=hps>java</span> <span class=hps>API</span> <span class=hps>and now</span> <span class=hps>I need</span><br><span class=hps>change the</span> <span class=hps>memory size of</span> <span class=hps>a</span> <span class=hps>vm.</span> <span class=hps>I am</span> <span class=hps>using the following code</span>:<br><br>    public void setMemorySize() {<br>        VirtualBoxManager mgr = VirtualBoxManager.createInstance(null);<br>        ISession session = mgr.getSessionObject();<br>        IVirtualBox vbox = mgr.getVBox();<br>        <br>        IMachine machine = vbox.getMachines().get(1);<br>        IProgress progress = machine.launchVMProcess(session, "gui", "");<br>        progress.waitForCompletion(-1);<br>        machine.lockMachine(session, LockType.Write); // machine is now locked for writing<br>        IMachine mutable = session.getMachine();<br>        // obtain the mutable machine copy<br>        mutable.setMemorySize((long) 1024);<br>        mutable.saveSettings();<br>        // write settings to XML<br>        session.unlockMachine();<br>    }<br><br><span class=hps>But</span>, returns the <span class=hps>following error</span>:</span><br><br>Exception in thread "main" org.virtualbox_4_1.VBoxException: The function "lockMachine" returned an error condition: "The given session is busy"  (0x80bb0007)<br>    at org.virtualbox_4_1.IMachine.lockMachine(IMachine.java:798)<br>    at teste.elasticidade.IniciaVM.setMemorySize(IniciaVM.java:51)<br>    at teste.elasticidade.IniciaVM.main(IniciaVM.java:37)<br><br clear=all><br><span class=hps><span lang=EN>what may</span></span><span class=shorttext><span lang=EN> </span></span><span class=hps><span lang=EN>be happening?</span></span><span lang=EN><br><br><span class=hps>thanks a lot.</span><br></span><br>-- <br>Rafael Braga<o:p></o:p></p></div><font face="monospace">---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</font></body></html>