diff --git a/repos/ports/ports/virtualbox.hash b/repos/ports/ports/virtualbox.hash
index f22e8de12..c3a0e9566 100644
--- a/repos/ports/ports/virtualbox.hash
+++ b/repos/ports/ports/virtualbox.hash
@@ -1 +1 @@
-7d0320bac1d65391cd0f548126df7399b8fb7f18
+2fc156a977246088b14dc9acad72ea3013c9e596
diff --git a/repos/ports/run/vbox_win.inc b/repos/ports/run/vbox_win.inc
index 479ffec60..51c122885 100644
--- a/repos/ports/run/vbox_win.inc
+++ b/repos/ports/run/vbox_win.inc
@@ -149,7 +149,7 @@ append config_of_app {
}
append config_of_app "
- "
+ "
append config_of_app {
diff --git a/repos/ports/src/virtualbox/frontend/console.cc b/repos/ports/src/virtualbox/frontend/console.cc
index a69b4d144..5c1c20be0 100644
--- a/repos/ports/src/virtualbox/frontend/console.cc
+++ b/repos/ports/src/virtualbox/frontend/console.cc
@@ -24,20 +24,29 @@ HRESULT Console::updateMachineState(MachineState_T aMachineState)
HRESULT Console::attachToTapInterface(INetworkAdapter *networkAdapter)
{
- HRESULT rc = S_OK;
-
ULONG slot = 0;
- rc = networkAdapter->COMGETTER(Slot)(&slot);
+ HRESULT rc = networkAdapter->COMGETTER(Slot)(&slot);
AssertComRC(rc);
maTapFD[slot] = (RTFILE)1;
- TRACE(S_OK)
+ TRACE(rc)
+}
+
+HRESULT Console::detachFromTapInterface(INetworkAdapter *networkAdapter)
+{
+ ULONG slot = 0;
+ HRESULT rc = networkAdapter->COMGETTER(Slot)(&slot);
+ AssertComRC(rc);
+
+ if (maTapFD[slot] != NIL_RTFILE)
+ maTapFD[slot] = NIL_RTFILE;
+
+ TRACE(rc)
}
HRESULT Console::teleporterTrg(PUVM, IMachine*, com::Utf8Str*, bool, Progress*,
bool*) DUMMY(E_FAIL)
-HRESULT Console::detachFromTapInterface(INetworkAdapter *networkAdapter) DUMMY(E_FAIL)
HRESULT Console::saveState(Reason_T aReason, IProgress **aProgress) DUMMY(E_FAIL)
STDMETHODIMP Console::COMGETTER(Debugger)(IMachineDebugger **aDebugger) DUMMY(E_FAIL)
@@ -103,7 +112,13 @@ HRESULT Console::onlineMergeMedium(IMediumAttachment *aMediumAttachment,
IProgress *aProgress) DUMMY(E_FAIL)
void fireStateChangedEvent(IEventSource* aSource,
- MachineState_T a_state) TRACE()
+ MachineState_T a_state)
+{
+ if (a_state != MachineState_PoweredOff)
+ return;
+
+ Genode::env()->parent()->exit(0);
+}
void fireRuntimeErrorEvent(IEventSource* aSource, BOOL a_fatal,
CBSTR a_id, CBSTR a_message)
diff --git a/repos/ports/src/virtualbox/patches/posix.patch b/repos/ports/src/virtualbox/patches/posix.patch
new file mode 100644
index 000000000..7aa24b9a5
--- /dev/null
+++ b/repos/ports/src/virtualbox/patches/posix.patch
@@ -0,0 +1,11 @@
+--- a/src/app/virtualbox/src/VBox/Runtime/r3/posix/path-posix.cpp
++++ b/src/app/virtualbox/src/VBox/Runtime/r3/posix/path-posix.cpp
+@@ -401,8 +401,6 @@
+ rc = errno == ENOENT ? VINF_SUCCESS : RTErrConvertFromErrno(errno);
+ else
+ {
+- Assert(SrcStat.st_dev && DstStat.st_dev);
+- Assert(SrcStat.st_ino && DstStat.st_ino);
+ if ( SrcStat.st_dev == DstStat.st_dev
+ && SrcStat.st_ino == DstStat.st_ino
+ && (SrcStat.st_mode & S_IFMT) == (DstStat.st_mode & S_IFMT))
diff --git a/repos/ports/src/virtualbox/patches/series b/repos/ports/src/virtualbox/patches/series
index 2508d667a..4eb5ca280 100644
--- a/repos/ports/src/virtualbox/patches/series
+++ b/repos/ports/src/virtualbox/patches/series
@@ -21,3 +21,4 @@ serial.patch
rem_irq.patch
usb.patch
tm_smp.patch
+posix.patch