Search This Blog

Tuesday, July 10, 2012

Change Linux Configuration in Hyper-V using Powershell

 

By default, VMM will deploy Linux VM template without OS Configuration and we are require to manually configure Linux VM setting such as computer name, ip address, dns, etc. Well, i’m not sure about you all but I'm NOT Linux expert. But luckly i found a way to achieve without going to Linux VM and make the necessary changes.

Before you read further, remember to create a Linux VM Termplate using VMM. Click here to learn on how to create Linux VM Template.

Once Linux VM has successful deployed, proceed to below step:-

0. Download SetLinuxVM Tool from http://www.setlinuxvm.com/. It is written in Powershell  by Yusuf Ozturk (MVP Powershell) and It's free.

1. First, you should allow signed Powershell scripts:

Set-ExecutionPolicy Allsigned
2. Extract file and move “SetLinuxVM” directory to “C:\Windows\System32\WindowsPowerShell\v1.0\Modules”. 

3. Remember to “Unblock” the Powershell script. To Unblock, select the powershell script, right click to select Properties and Click Unblock. Repeat this step for the entire powershell script.


3. Import as a module:
Import-Module SetLinuxVM


4.Change VM computer name to suse03.pcloud.local
set-linuxvm –vmname Suse02 –username root –Password password –Hostname suse04.pcloud.local


image


5. Change IP address
Set-LinuxVM -VMName "Suse02" Username "root" -Password "password" IPAddress "192.168.128.150" -SubnetMask "255.255.255.0" -GatewayAddress "192.168.128.150" -PrimaryDNSAddress "8.8.8.8"


image


Once you have execute the above command, you can view the process in Terminal.


image


Above is just an example which I've tested. For more setting, do visit Yusuf blog.


Nice tool to make my life simpler.

5 comments:

  1. Hi Lai,

    First of all, I'm glad to see this post :) It makes me happy to see its working.

    One Tip: If you add "-Distro" switch on your command, provisioning will be faster.

    Regards,
    Yusuf.

    ReplyDelete
  2. Hi Yusuf,

    Thanks for the info and by the way great tool that you have there.
    Keep up the good work!

    Cheers,
    Lai

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. No matter what type of Michael Kors Bags Outlet each individual got, they all had one thing in common. We all know that getting something on sale is like winning a mini lottery, but to find a name brand handbag like Michael Kors Black Friday Sale for instance, discounted is like a slice of heaven on earth. I have personally attacked my husband with hugs and kisses when finding Official Coach Outlet Online at discounted prices.

    Michael Kors Factory Outlet stores can be found in malls all over. MK Outlet and other Coach merchandise can also be found in some boutiques. Inspired by the same material baseball gloves are made from, these Coach Bags On Sale Online are versatile and stylish. Since it's conception, the Michael Kors Handbags Outlet has been produced into a variety of designs, colors, shapes, and styles that have won top pick of millions of women the world over.

    New Michael Kors Bags are the most sought after handbag. Since Coach Outlet Online is one of the most recognized name brands in the world of fashion, you will find A-list celebrities down to small girls wearing them.

    tags:Coach Outlet|Coach Bags Factory Outlet|Coach Purses Outlet

    ReplyDelete