RyanTAdams.com

Technology Advice by Ryan Taylor Adams

Virtual PC 2007 Command Line Options

February 19th, 2008 · 3 Comments · Printer Friendly Version

WARNING! THIS POST IS MORE THAN 180 DAYS OLD!

While I make an effort to update older posts to keep them relevant and technically accurate, the rapidly changing nature of the tech world makes it possible that the content of this post may no longer be relevant, current, or even accurate. Additionally, because of this post's age, adding new comments has been disabled. If you would like to contribute new information to this post, or have questions pertaining to this post, please use the Contact Form.


Virtual PC.exe is the Virtual PC command-line utility and can be used to perform a variety of Virtual PC and virtual machine tasks. By default, it is located in \Program Files\Microsoft Virtual PC. The following is a list of all supported command line options for Virtual PC 2007.


Syntax:

“Virtual PC.exe”[-singlepc] [-quiet][-usehostdiskcache][-pc virtual_machine_name [[-disableclose][-disableopt][-s3bitclip][-setbiosno bios_serial_number][-setassettag asset_tag] [-extnetworking]-launch] [{-fullscreen|-window}][-geometry widthxheight{+|-}x offset{+|-}y offset][{-minimize|-restore}][{-pause|-resume}]][-help][-registervm filename.vmc][-startvm filename.vmc] 

Parameters:

Command-line arguments are case-sensitive, but the parameters passed to these commands are not case-sensitive.

-singlepc Starts the specified virtual machine without starting Virtual PC Console. This parameter can be useful for simplifying the Virtual PC interface in a corporate or lab environment, where users only want to access a virtual machine and do not need access to Virtual PC Console. This parameter can be used only when starting Virtual PC.
-quiet Prevents the starting of any virtual machines that are configured to start automatically. This parameter can be used only when starting Virtual PC.
-usehostdiskcache Turns on host-side disk caching, which can improve performance of virtual machines running operating systems other than Windows. This parameter can be useful for resolving poor performance problems with disk intensive tasks. This parameter can be used only when starting Virtual PC.
-registervm filename.vmc Registers the specified .vmc file, which adds the corresponding virtual machine to the list of virtual machines. This parameter can be useful for using an automated deployment to register a .vmc without launching it. This parameter can be used only when the virtual machine is not running. An absolute path to the .vmc file is required.
-startvm filename.vmc Registers the specified .vmc file, which adds the corresponding virtual machine to the list of virtual machines, and starts the virtual machine. This parameter can be used only when starting the virtual machine. An absolute path to the .vmc file is required
-pc virtual_machine_name Performs operations on a specific virtual machine. The virtual_machine_name is the name that appears in Virtual PC Console and the virtual machine window for the virtual machine. The virtual_machine_name is case-sensitive. The following table describes the options for this parameter.

Value

Description
-disableclose Disables the Close button on the specified virtual machine. This parameter can be used only when starting the virtual machine.
-disableopt Disables any direct mode execution within the specified virtual machine. This parameter can be useful for providing a temporary resolution for poor stability of applications on a guest operating system. This parameter can be used only when starting the virtual machine.
-s3bitclip Clips accelerated S3 bit coordinates to 12 bits on the specified virtual machine. This parameter can be used only when starting the virtual machine.
-setbiosno bios_serial_number Sets the BIOS serial number of the specified virtual machine to the value specified. This can be useful for tracking Virtual PCs when using hardware management software. This parameter can be used only when starting the virtual machine.
-setassettag asset_tag Sets the chassis asset tag of the specified virtual machine to the value specified. This can be useful for tracking Virtual PCs when using hardware management software or tracking other specific information. This parameter can be used only when starting the virtual machine.
-extnetworking Specifies that all network connections on the specified virtual machine operate in external only mode. This limits the access of the virtual machine to only resources external to the physical computer. This parameter can be used only when starting the virtual machine. This parameter does not affect the network connections of the virtual machines that are configured to use shared networking.
-launch Starts the specified virtual machine. Specify this parameter after -pc and any other optional parameters shown before -launch in the syntax section.
-fullscreen Switches a running virtual machine to full-screen mode. This parameter can be used only when the virtual machine is running.
-window Switches a virtual machine running in full-screen mode to window mode. This parameter can be used only when the virtual machine is running.
-geometry widthxheight{+|}x offset{+|}y offset Specifies the location and window size of the specified virtual machine. The offsets are relative to the upper left corner of the screen. Use of x offset and y offset is optional. This parameter can be used only when the virtual machine is running.
-minimize Minimizes the specified virtual machine. This parameter can be used only when the virtual machine is running.
-restore Brings the specified virtual machine to the foreground of the screen. This parameter can be used only when the virtual machine is running.
-pause Pauses the specified virtual machine. This parameter can be used only when the virtual machine is running.
-resume Restores a paused virtual machine to an active state. This parameter can be used only when the virtual machine is running.

3 responses so far ↓

  • 1 Prabhu // Dec 30, 2008 at 10:23 PM


    Hi,
    I want to automate creating the virtual disks using command line and bringing them up with different options. Please let me know if there any ways for doing that.

    Thanks,
    Prabhu

  • 2 Ryan Adams // Dec 31, 2008 at 12:49 PM


    @Prabhu: I’m not aware of a way to do that with the command line switches. There may be some third party tools available to do this though.
    Here is a link to get you started in the right direction: http://blogs.msdn.com/virtual_pc_guy/archive/2008/09/30/hyper-v-scripting-fixed-vhd-creation.aspx

  • 3 Gunivortus Goos // Jan 21, 2009 at 7:03 AM


    Is there an option to start the Virtual PC console AND the Virtual Machine minimized?

    I’ve set it now to:
    “C:\Program Files (x86)\Microsoft Virtual PC\Virtual PC.exe” -startvm E:\VPC\VirtualPC.vmc

    but it shouldn’t be on the screen, because the VM will be accessed directly through the network.

  • 4 Ryan Adams // Jan 21, 2009 at 8:25 AM


    @Gunivortus Goos: You can try creating a shortcut which points to “C:Program Files (x86)Microsoft Virtual PCVirtual PC.exe” -startvm E:VPCVirtualPC.vmc . Then changing the properties of the shortcut to “Run: Minimized”.

  • 5 Gunivortus Goos // Jan 21, 2009 at 8:34 AM


    Hy Ryan,
    thanks for your answer.
    I might not have been clear enough, I ment at starting the host system. I’ve put that line above in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    So VPC and the VM already start at start of the host system. Now I like to get it directly minimized.
    Is that possible?

  • 6 Ryan Adams // Jan 21, 2009 at 9:43 AM


    @Gunivortus Goos: You could move the shortcut to the “Startup” folder to achieve the same effect as putting it in the registry.

    You may want to look into VirtualBox, which is also free and allows you to run “headless” servers designed for network access, among other nifty features.