Tip: How do I Shut Down a Virtual Machine?


There are times when you may want to shut down a Windows® operating system on a Virtual Machine (VM) created using Windows Virtual PC (WVPC). In Windows® XP Mode, by default, the VM gets hibernated upon closing the VM’s window. There are various ways to shut down Windows on the VM:

Use Windows functionality (Recommended)

1. On the VM Windows’s toolbar, click Ctrl+Alt+Del menu item.  Alternatively, you can also press the Ctrl+Alt+End key combination on your keyboard.

Fig. 1

Figure 1:  Using Ctrl+Alt+Del for the VM as a toolbar menu item

2.  This opens the Windows Security window inside the VM. Click on the Shut Down button.

Fig 2

Figure 2:  Shutting down the VM using the familiar Windows Security dialog options 

3. On the new window, choose the Shut Down option from the drop down.

Fig 3

Figure 3:  Shutting down the VM

Use Windows Virtual PC functionality

1. On the VM Windows’s toolbar, click Tools menu item, and click Settings in the drop down menu.

Fig 4

Figure 4:  Using the Windows Virtual PC Settings option to shutdown a VM

2. This opens the VM’s settings window. On the left navigation pane, click on “Close” option.

Fig 5

Figure 5:  Using the ‘Close’ option in Windows Virtual PC Settings

3. Choose the “Prompt for action” option, and then click “OK”.  Whenever you close the VM’s window, you will be prompted to choose which action to take. You can choose to shut down the virtual machine.

Fig 6

Figure 6.  Setting to automatically shutdown a VM every time the VM window is closed

4. Alternatively, If you want to shut down the VM each time you close the VM’s window, then choose the Shut Down option from the drop down menu under the “Automatically close with following action:" option. If you select this option, the VM will shut down each time you close the VM’s window.

Note: This is not a recommended option as it would result in the VM having to boot up from a shutdown stage whenever you launch the VM, or any virtual application for this VM. This significantly increases start up time for the VM or the virtual application.

Rahul Razdan

Program Manager

Microsoft Virtualization Team

Comments (20)

  1. @David: Would you please provide more details (trying to launch a virtual application automatically on every boot up of Windows 7 or trying to launch the full VM etc.)?  You can use the email link on the blog (right top corner).  Thanks.

    Prasad Saripalli (MSFT)

  2. David says:

    Interesting blog, but how could you get your XP mode to automatically boot up every time You login to Windows 7?

  3. 7flavor says:

    Moving the "Commit changes to disk" option to the settings window is causing me immense inconvenience. Please bring it back to the shutdown/save/discard undo disk info box as a checkbox.

  4. Derek McLean says:

    My XPMode freezes after a few minutes if I’m trying to install an application from a USB, or trying to copy a folder from a USB.

    When it does this, it refuses to shut down, and so becomes totally useless.

    I have installed it several times in both 32-bit and 64-bit versions of 7 Pro N.

    Can anybody tell me what is going on, and whether I have wasted my money buying a new PC with HAV?

  5. kapitbahay says:

    This is absolutely useless if your XP mode won’t shutdown. What is needed is to include info how to FORCEFULLY shut it down.

  6. Noushad says:

    Excellent.  Thanks alot.  This meant that I forced a shut down which was still fine.

  7. rudy says:

    Hi, I use XP mode + windows 7 and would like to change shutdown behavior for headless VM mode.

    The "close" option control the action when close button clicked. But, if virtual PC running in headless mode,

    I mean non-desktop mode, there is no "close" button. Just application window appears in desktop on windows 7.

    In this case, if I logoff the windows 7, application in XP mode, for instance IE6, will go into hibernate mode.

    I think this is default action of XP mode when host OS is shutdown. But, I want to change this behevior to shutdown.

    The reasion is that I use application distribution tool in XP mode which launched by logon script. So, if XP mode is in hibernate,

    logon script never executed and it cause my distribution tool never runs. Any ideas?. Thanks in advance.

  8. Eric says:

    I am having a problem.

    I have transferred a hibernated-VMC from PC-A to PC-B.

    The VMC is configured to have 2GB memory. However the RAM in PC-B is only 2GB and cannot delicate all to the VMC obviously.

    I’m not able to start the VMC in PC-B.

    Moreover, i cannot reduce the memory allocation of VMC until I shutdown it (which i’m not able to shut down because I cannot start it, lol)

    Is there any hope?

  9. kennedy says:

    I had  the exact problem….changed the setting to shut down, didn't work, at "Choose the Prompt for action”, I chose Turn Off, and it worked…but I think I lost the microsoft office.

    Thanks, nice article.

  10. Richard says:

    I am having a similar problem…I cannot open my hibernated VMC…It worked fine on thursday, and then friday I cant open it…any suggestions?  

  11. Lydia Fleeman says:

    I am running only certain applications in Windows XP Mode. I don't understand how I am supposed to shut down or log off the virtual machine. The VM starts when I launch the application from the Windows 7 desktop. When I log off, I either get a message that the virtual machine needs to shut down, or I get a message that the machine was shut down with a user logged in when I boot up and launch the program again. The proper way to shut down the virtual machine (without shutting down windows 7) is still unclear to me.

  12. ciber71 says:

    is there a way to desinstall windows xp mode? suddenly XPMUser asked password and I never had any! and will not let me start xp mode. would have to uninstall it to reinstall back. but no idea how. please help!

  13. WG says:

    Windows 7 in XPMODE LOCKED UP IN AUTOCAD THE SCREEN IS FROZEN,

    Virtual PC AP Mode will not shut down and will not allow me to close AutoCad.

  14. Ranjeet says:

    I had exactly the same problem. I could not shut down XPMODE but when I followed this blog I was able to do it. Thanks everyone

  15. Josue Lopez says:

    When I running programs hosted on the virtual machine directly in W7 can not run the shutdown actions WXP because the desktop does not open, it is assumed that when you close the program you opened the machine turns off, but not if there are applications background running. I created a shortcut to "shutdown-s" and stayed in the folder of hits on one of the programs I use, and after closing the program simply I execute this link and I turned off the VM.

  16. Rocksteady777 says:

    How do you close the virtual pc in the background (ex. it does this when you open a program integrated from xp mode)

  17. spangdevco says:

    Windows 7 Virtual PC, XP Mode

    message reads "This computer is in use and has been locked"

    From toolbar to Settings to Shut Down, but nothing happens

    I need to force Shut Down or unlock

  18. dendrite says:

    Start Menu –> "Windows Security" –> Shut Down (select and action: Log off <user>, Shut down, Restart, Stand by, Disconnect) –> "OK"

  19. gustav says:

    Nice article – But I’m locked in XP Mode and can’t close it
    And none of your options are working – strange !