«

»

Jun 09

Changing VM Boot Order with PowerCLI

There are times where I want to load a live cd on a Virtual Machine or I wish to change the boot order to a 2nd HDD for some testing/troubleshooting purposes. I got tired of restarting the virtual machines into the BIOS to change the boot order, so here is some code that should help you if you are in the same boat as I was.

You’ll want to change the vm within the $vm variable as well as decide which devices you want booting first on the BootOrder line. The example below will boot from CD first before trying to boot the 1st HDD.

Note* If you have more than one cd-drive on a virtual machine, the bios will boot from the first virtual CD-rom drive with bootable content, so plan accordingly. When I deploy an unattended Windows install I place the Windows.iso on the 2nd CD-rom drive so that a batch file can mount VM-tools to the 1st after bootup.

1 comment

  1. JD

    Great write up… It appears you can no longer add this setting directly to the configuration parameters. This is what I needed.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

3 × 3 =