Index: trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
===================================================================
--- trunk/src/VBox/Frontends/VBoxShell/vboxshell.py	(revision 29813)
+++ trunk/src/VBox/Frontends/VBoxShell/vboxshell.py	(revision 29848)
@@ -495,5 +495,5 @@
             # to allow sleep interruption
             pass
-    all_stats = ctx['ifaces'].all_values('GuestStatisticType')
+    all_stats = ctx['const'].all_values('GuestStatisticType')
     cpu = 0
     for s in all_stats.keys():
@@ -532,5 +532,5 @@
 
 def printSf(ctx,sf):
-    print "    name=%s host=%s %s %s" %(sf.name, sf.hostPath, cond(sf.accessible, "accessible", "not accessible"), cond(sf.writable, "writable", "read-only"))
+    print "    name=%s host=%s %s %s" %(sf.name, colPath(ctx,sf.hostPath), cond(sf.accessible, "accessible", "not accessible"), cond(sf.writable, "writable", "read-only"))
 
 def ginfo(ctx,console, args):
@@ -569,5 +569,5 @@
             traceback.print_exc()
         return
-    if session.state != ctx['ifaces'].SessionState_Open:
+    if session.state != ctx['const'].SessionState_Open:
         print "Session to '%s' in wrong state: %s" %(mach.name, session.state)
         session.close()
@@ -684,5 +684,5 @@
 
 def asEnumElem(ctx,enum,elem):
-    all = ctx['ifaces'].all_values(enum)
+    all = ctx['const'].all_values(enum)
     for e in all.keys():
         if str(elem) == str(all[e]):
@@ -691,5 +691,5 @@
 
 def enumFromString(ctx,enum,str):
-    all = ctx['ifaces'].all_values(enum)
+    all = ctx['const'].all_values(enum)
     return all.get(str, None)
 
@@ -733,9 +733,9 @@
     print "  APIC [BIOSSettings.IOAPICEnabled]: %s" %(asState(bios.IOAPICEnabled))
     hwVirtEnabled = mach.getHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_Enabled)
-    print "  Hardware virtualization [mach.setHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_Enabled,value)]: " + asState(hwVirtEnabled)
-    hwVirtVPID = mach.getHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_VPID)
-    print "  VPID support [mach.setHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_VPID,value)]: " + asState(hwVirtVPID)
-    hwVirtNestedPaging = mach.getHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_NestedPaging)
-    print "  Nested paging [mach.setHWVirtExProperty(ctx['global'].constants.HWVirtExPropertyType_NestedPaging,value)]: " + asState(hwVirtNestedPaging)
+    print "  Hardware virtualization [guest win machine.setHWVirtExProperty(ctx[\\'const\\'].HWVirtExPropertyType_Enabled,value)]: " + asState(hwVirtEnabled)
+    hwVirtVPID = mach.getHWVirtExProperty(ctx['const'].HWVirtExPropertyType_VPID)
+    print "  VPID support [guest win machine.setHWVirtExProperty(ctx[\\'const\\'].HWVirtExPropertyType_VPID,value)]: " + asState(hwVirtVPID)
+    hwVirtNestedPaging = mach.getHWVirtExProperty(ctx['const'].HWVirtExPropertyType_NestedPaging)
+    print "  Nested paging [guest win machine.setHWVirtExProperty(ctx[\\'const\\'].HWVirtExPropertyType_NestedPaging,value)]: " + asState(hwVirtNestedPaging)
 
     print "  Hardware 3d acceleration [accelerate3DEnabled]: " + asState(mach.accelerate3DEnabled)
@@ -778,5 +778,5 @@
             print "   HDD:"
             print "    Id: %s" %(m.id)
-            print "    Location: %s" %(m.location)
+            print "    Location: %s" %(colPath(ctx,m.location))
             print "    Name: %s"  %(m.name)
             print "    Format: %s"  %(m.format)
@@ -788,9 +788,9 @@
                 print "    Name: %s" %(m.name)
                 if m.hostDrive:
-                    print "    Host DVD %s" %(m.location)
+                    print "    Host DVD %s" %(colPath(ctx,m.location))
                     if a.passthrough:
                          print "    [passthrough mode]"
                 else:
-                    print "    Virtual image at %s" %(m.location)
+                    print "    Virtual image at %s" %(colPath(ctx,m.location))
                     print "    Size: %s" %(m.size)
 
@@ -801,7 +801,7 @@
                 print "    Name: %s" %(m.name)
                 if m.hostDrive:
-                    print "    Host floppy %s" %(m.location)
+                    print "    Host floppy %s" %(colPath(ctx,m.location))
                 else:
-                    print "    Virtual image at %s" %(m.location)
+                    print "    Virtual image at %s" %(colPath(ctx,m.location))
                     print "    Size: %s" %(m.size)
 
@@ -996,5 +996,8 @@
     if mach == None:
         return 0
-    cmdExistingVm(ctx, mach, 'guest', ' '.join(args[2:]))
+    if str(mach.sessionState) != str(ctx['const'].SessionState_Open):
+        cmdClosedVm(ctx, mach, lambda ctx, mach, a: guestExec (ctx, mach, None, ' '.join(args[2:])))
+    else:
+        cmdExistingVm(ctx, mach, 'guest', ' '.join(args[2:]))
     return 0
 
@@ -1083,5 +1086,5 @@
     if mach == None:
         return 0
-    if str(mach.sessionState) != str(ctx['ifaces'].SessionState_Open):
+    if str(mach.sessionState) != str(ctx['const'].SessionState_Open):
         if mach.CPUHotPlugEnabled:
             cmdClosedVm(ctx, mach, plugcpu, [True, int(args[2])])
@@ -1097,5 +1100,5 @@
     if mach == None:
         return 0
-    if str(mach.sessionState) != str(ctx['ifaces'].SessionState_Open):
+    if str(mach.sessionState) != str(ctx['const'].SessionState_Open):
         if mach.CPUHotPlugEnabled:
             cmdClosedVm(ctx, mach, plugcpu, [False, int(args[2])])
@@ -1787,5 +1790,5 @@
    progress = hdd.createBaseStorage(size, ctx['global'].constants.MediumVariant_Standard)
    if progressBar(ctx,progress) and hdd.id:
-       print "created HDD at %s as %s" %(hdd.location, hdd.id)
+       print "created HDD at %s as %s" %(colPath(ctx,hdd.location), hdd.id)
    else:
       print "cannot create disk (file %s exist?)" %(loc)
@@ -1940,5 +1943,5 @@
 
    progress = dvd.close()
-   print "Unregistered ISO at %s" %(dvd.location)
+   print "Unregistered ISO at %s" %(colPath(ctx,dvd.location))
 
    return 0
@@ -1959,5 +1962,5 @@
    progress = dvd.deleteStorage()
    if progressBar(ctx,progress):
-       print "Removed ISO at %s" %(dvd.location)
+       print "Removed ISO at %s" %(colPath(ctx,dvd.location))
    else:
        reportError(ctx,progress)
@@ -2545,5 +2548,5 @@
     '''
     if len(args) == 1:
-        nictypes = ctx['ifaces'].all_values('NetworkAdapterType')
+        nictypes = ctx['const'].all_values('NetworkAdapterType')
         for n in nictypes.keys():
             if str(adapter.adapterType) == str(nictypes[n]):
@@ -2551,5 +2554,5 @@
         return (1, None)
     else:
-        nictypes = ctx['ifaces'].all_values('NetworkAdapterType')
+        nictypes = ctx['const'].all_values('NetworkAdapterType')
         if args[1] not in nictypes.keys():
             print '%s not in acceptable values (%s)' % (args[1], nictypes.keys())
@@ -2922,5 +2925,5 @@
            'mgr':g_virtualBoxManager.mgr,
            'vb':g_virtualBoxManager.vbox,
-           'ifaces':g_virtualBoxManager.constants,
+           'const':g_virtualBoxManager.constants,
            'remote':g_virtualBoxManager.remote,
            'type':g_virtualBoxManager.type,
