id,summary,reporter,owner,description,type,status,component,version,resolution,keywords,cc,guest,host 9549,VirtualBox GUI Intermittently Hangs at Startup of Virtual Machine => Fixed in SVN,Arend Dittmer,,"I am creating, configuring and running a virtual machine named mypocket7 from a script through VBoxManage. After the Virtual Machine is created with createvm the script attaches two immutable virtual hard drives in vmdk format to the created vm. The virtual hard drives are stored on a USB flash drive formatted with FAT32. The script also attaches a page volume vmdk from local disk and a DVD {{{ VBoxManage storageattach MyPocket7 --storagectl ""IDE Controller"" --port 0 --device 0 --type hdd --mtype immutable --medium ""/Volumes/MYPOCKET7/vm-images/usbcomp_7.vmdk"" VBoxManage storageattach MyPocket7 --storagectl ""IDE Controller"" --port 0 --device 1 --type hdd --mtype immutable --medium ""/Volumes/MYPOCKET7/vm-images/usbcomp_user.vmdk"" VBoxManage storageattach MyPocket7 --storagectl ""IDE Controller"" --port 1 --device 0 --type hdd --medium ""/tmp/vmusbcomp2736/pagefile_vol_vmware.vmdk"" VBoxManage storageattach MyPocket7 --storagectl ""IDE Controller"" --port 1 --device 1 --type dvddrive --medium host:'host:MATSHITA DVD-R UJ-898' --passthrough on }}} The script then launches the vm. I have tried {{{ VirtualBox"" --startvm MyPocket7 }}} and {{{ VBoxManage"" startvm MyPocket7 }}} with the same result: The VirtualBox GUI 'hangs' intermittently at startup before a log file is created. While the 'hang' occurs intermittently, when it occurs OSX always reports the same stack trace for the VirtualBox/VBoxManage process. I have observed the hang with Snow Leopard as well as Lion and on both of the Macs I own (a Mac Mini and a Macbook). The main VirtualBox/VBoxManage thread hangs at {{{ 17 Console::powerUp(IProgress**, bool) + 6109 (in VBoxC.dylib) [0x1052c6f1d] 17 SharedStub + 91 (in VBoxXPCOM.dylib) [0x1028c759b] 17 PrepareAndDispatch + 507 (in VBoxXPCOM.dylib) [0x1028c8368] 17 DConnectStub::CallMethod(unsigned short, nsXPTMethodInfo const*, nsXPTCMiniVariant*) + 1471 (in VBoxXPCOMIPCC.dylib) [0x102cbeefb] 17 IPC_WaitMessage(unsigned int, nsID const&, ipcIMessageObserver*, ipcIMessageObserver*, unsigned int) + 242 (in VBoxXPCOMIPCC.dylib) [0x102cb5cea] 17 _ZL10WaitTargetRK4nsIDjPP10ipcMessagePFjPvP13ipcTargetDataPKS2_ES5_ + 632 (in VBoxXPCOMIPCC.dylib) [0x102cb597c] }}} Within the same process a second thread that was spawned by the main thread and enumerates media waits as well {{{ 17 VBoxGlobal::startEnumeratingMedia()::MediaEnumThread::run() + 444 (in VirtualBox.dylib) [0x10106f41c] 17 VBoxMedium::blockAndQueryState() + 101 (in VirtualBox.dylib) [0x10102c405] 17 CMedium::RefreshState() + 61 (in VirtualBox.dylib) [0x10122077d] 17 SharedStub + 91 (in VBoxXPCOM.dylib) [0x1028c759b] 17 PrepareAndDispatch + 507 (in VBoxXPCOM.dylib) [0x1028c8368] 17 DConnectStub::CallMethod(unsigned short, nsXPTMethodInfo const*, nsXPTCMiniVariant*) + 1471 (in VBoxXPCOMIPCC.dylib) [0x102cbeefb] 17 IPC_WaitMessage(unsigned int, nsID const&, ipcIMessageObserver*, ipcIMessageObserver*, unsigned int) + 242 (in VBoxXPCOMIPCC.dylib) [0x102cb5cea] 17 _ZL10WaitTargetRK4nsIDjPP10ipcMessagePFjPvP13ipcTargetDataPKS2_ES5_ + 632 (in VBoxXPCOMIPCC.dylib) [0x102cb597c] }}} The complete stack trace generated after the OSX 'force quit' is attached. I did a little homework looking at the relevant code sections and believe that there may be a race condition between two threads in the VirtualBox/VBoxManage process. There is one thread that enumerates the media list in startEnumerating media and there is a second thread that looks for immutable images to reset, which can probably not complete as the enumeration thread is still working. I wonder if this issue is only a problem when storing immutable drives on a USB flash drive resulting in a 'slower' device enumeration that conflicts with the powerUp call during which VirtualBox/VBoxManage looks for immutable images to reset. {{{ if (!fCurrentSnapshotIsOnline) { LogFlowThisFunc((""Looking for immutable images to reset\n"")); com::SafeIfaceArray atts; rc = mMachine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts)); ... }}} ",defect,closed,GUI,VirtualBox 4.0.12,fixed,hang osx startup,arend@…,other,Mac OS X