Wait for pipe file to be created before starting the remote console for VMware and VirtualBox VMs. Fixes #331.

This commit is contained in:
grossmj committed 2015-10-11 15:50:50 -06:00
1 parent 9c23093510
commit ee6ef9f3d5
3 files changed
+22 -1

No files matched your search

@@ -30,6 +30,7 @@ import asyncio
from pkg_resources import parse_version
from gns3server.utils.telnet_server import TelnetServer
from gns3server.utils.asyncio import wait_for_file_creation
from .virtualbox_error import VirtualBoxError
from ..nios.nio_udp import NIOUDP
from ..nios.nio_nat import NIONAT
@@ -214,6 +215,10 @@ class VirtualBoxVM(BaseVM):
yield from self.manager.execute("guestproperty", ["set", self._vmname, "ProjectDirInGNS3", self.working_dir])
if self._enable_remote_console and self._console is not None:
try:
yield from wait_for_file_creation(self._get_pipe_name()) # wait for VirtualBox to create the pipe file.
except asyncio.TimeoutError:
raise VirtualBoxError('Pipe file "{}" for remote console has not been created by VirtualBox'.format(self._get_pipe_name()))
self._start_remote_console()
if (yield from self.check_hw_virtualization()):