VirtualBox

Opened 9 years ago

Last modified 9 years ago

#13763 reopened defect

Problem with setextradata GUI/Seamless on

Reported by: batyr Owned by:
Component: VM control Version: VirtualBox 4.3.20
Keywords: VBoxManage Seamless Cc:
Guest type: Windows Host type: Windows

Description

Hello. I develop on c#. I'm trying to start VirtualBox VM to SeamlessMode via VBoxManage.exe in command line under Windows 7/8/8.1 host. The problem is that it works, but not all the time. If the host computer is powerful then the success rate of starting VM in seamless mode is about 90%. If the host machine is slow then the success rate drops to 50%. Please see the attached snippet (VM starting in seamless mode)

restoreSnapshot();
setSeamlessMode();
runVM();

public static void restoreSnapshot() {

Process VBoxManage = new Process();

VBoxManage.StartInfo.CreateNoWindow = true; VBoxManage.StartInfo.FileName = VBoxManageEXE; VBoxManage.StartInfo.WorkingDirectory = VBoxPath; VBoxManage.StartInfo.Arguments = "snapshot VM restore Snap1"; VBoxManage.StartInfo.UseShellExecute = false; VBoxManage.StartInfo.RedirectStandardOutput = true; VBoxManage.Start();
String line = "";

while (!VBoxManage.StandardOutput.EndOfStream) {

line = VBoxManage.StandardOutput.ReadToEnd();

} VBoxManage.Dispose();

}

public static void setSeamlessMode() {

Process VBoxManage = new Process();

VBoxManage.StartInfo.CreateNoWindow = true; VBoxManage.StartInfo.FileName = VBoxManageEXE; VBoxManage.StartInfo.WorkingDirectory = VBoxPath; VBoxManage.StartInfo.Arguments = "setextradata VM GUI/Seamless on"; VBoxManage.StartInfo.UseShellExecute = false; VBoxManage.StartInfo.RedirectStandardOutput = true; VBoxManage.Start();
String line = "";

while (!VBoxManage.StandardOutput.EndOfStream) {

line = VBoxManage.StandardOutput.ReadToEnd();

} VBoxManage.Dispose();

}

public static void runVM() {

Process VBoxManage = new Process();

VBoxManage.StartInfo.CreateNoWindow = true; VBoxManage.StartInfo.FileName = VBoxManageEXE; VBoxManage.StartInfo.WorkingDirectory = VBoxPath; VBoxManage.StartInfo.Arguments = "--nologo startvm VM -type GUI"; VBoxManage.StartInfo.UseShellExecute = false; VBoxManage.StartInfo.RedirectStandardOutput = true; VBoxManage.Start();

String line = "";
while (!VBoxManage.StandardOutput.EndOfStream) {

line = VBoxManage.StandardOutput.ReadToEnd();

} VBoxManage.Dispose();

}

Change History (8)

comment:1 by kenny, 9 years ago

I would like to add that I am also experiencing this issue on 4.3.20 with Window7/8/8.1 as host.

The 90% success for faster computers, and 50% for slower computers are in the same ballpark as what I'm seeing.

To reproduce the low seamless success rate, try Intel i3 or lower computer with 5400 rpm hardrive with VT-x disabled.

The % of successful seamless drops even more when VT-x is disabled in the BIOS.

comment:2 by Klaus Espenlaub, 9 years ago

Can you provide a VBox.log file for two VM runs (otherwise identical) which show both working/not working variant? It's listed in the Troubleshooting section of the manual as a vital piece of information when asking for help.

comment:3 by Klaus Espenlaub, 9 years ago

Also, what are your expectations? It would help to get screenshots of the situations where seamless wasn't active. After all there are many situations where seamless can't be active right now (VM not prepared to change resolution etc etc.), and that's nothing which can be changed easily.

comment:4 by batyr, 9 years ago

By digging deeper into this issue, I found out that if I create a new snapshot after rebooting a guest VM then the problem persists (still have only 50% success ratio). But if I create another snapshot from the first snapshot then the problem disappears and I have 100% success rate. So if I recreate a snapshot (second time) after reboot, the seamless VM starting works 100%.

So the current solution is:

Guest OS - Windows XP SP3

  1. Turn on the VM and wait until guest OS gets loaded (no snapshots at this moment)
  2. Create the first snapshot (if I revert this snapshot with seamless it works only at 50% success rate)
  3. Revert snapshot and create a new one from this one (if I revert the new one with seamless it works 100%)

comment:5 by kenny, 9 years ago

For me, this has been fixed with the 4.3.22 release.

comment:6 by Frank Mehnert, 9 years ago

Resolution: fixed
Status: newclosed

Thanks for the feedback. Please reopen if necessary.

comment:7 by batyr, 9 years ago

It sames that the latest build 4.3.26 did not solve the seamless mode problem. In my experience it still persists - doesn't switch to seamless mode every time. We had to download the source code 4.3.26 and fix it for now.

The problem is that m_machineState variable (in src\VBox\Frontends\VirtualBox\src\runtime\UISession.cpp) sometimes is not set to KMachineState_Running state where it is supposed to be (m_machineState = 13!!! it's not correct). Then it does not pass the check on "VM running" status and as a result VM goes to default mode (normal mode).

To fix the problem we had to add just one single line to the code. The added coded line: m_machineState = KMachineState_Running; The place where the line was added in: powerUp function (src\VBox\Frontends\VirtualBox\src\runtime\UISession.cpp) The original code:

#ifdef VBOX_GUI_WITH_PIDFILE
    vboxGlobal().createPidfile();
#endif

    /* Warn listeners about machine was started: */
    emit sigStarted();
} 

The modified code:

#ifdef VBOX_GUI_WITH_PIDFILE
    vboxGlobal().createPidfile();
#endif

    /* Warn listeners about machine was started: */
    m_machineState = KMachineState_Running; // <--- A new line added
    emit sigStarted();
} 
Last edited 9 years ago by batyr (previous) (diff)

comment:8 by batyr, 9 years ago

Resolution: fixed
Status: closedreopened
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use