Howto Expand disk in VirtualBox for mac

I created a new Windows 10 client in my Mac that I have in an assignment and that on VirtualBox. I made it to small of course and when trying to add some stuff with onedrive sync I could not succeed …

So to be able to expand the underlying disk in virtualbox I had to go into terminal mode as this is not part of the gui which of course is okay, so find your vdi file and possible if you are afraid, do a copy of the file before and of course the VM have to be stopped during the expansion.

Using command VBoxManage modifymedium disk  xxxx.vdi –resizebytes  85899345920

Screen Shot 2016-05-27 at 14.12.11

and checking the properties on the virtual disk file I can see that it has been expanded

Screen Shot 2016-05-27 at 14.12.03

after that you boot the VM and go into windows disk settings and expand the partition and you are ready to add files 🙂

Screen Shot 2016-05-27 at 14.13.51

Upgrade to Windows Server 2016 TP5 – Live migrate from TP4

So the day have come when finally the new TP5 bits have been released! And I of course downloaded and wanted to test to upgrade one of my hyper-v servers in my home lab.

Screen Shot 2016-04-27 at 21.53.33

Once installed I tried to migrate a VM from the hyper-v manager at the new TP5 node, I had of course set up kerberos and delegation before but still it gave me an error. To see if it was just in the GUI or also in PowerShell I tried the same move and got the same issue

Screen Shot 2016-04-27 at 23.26.57

So powershell remoting to the rescue to test that I could live migrate my VM´s from the TP4 to the TP5 and that worked nicely. I will dig some more into if there is an issue with the AD objects or what causes this and do an update if I find anything…

Screen Shot 2016-04-27 at 23.27.44

happy testing!

 

Add Chocolatey to my PackageManagement in Windows 10

I wanted to install the different browsers and also ChefDK on an new Windows 10 client and that with PowerShell. There is of course a way to just run Chocolatey command line but I wanted to use the PackageManagement so I had to add that provider and source so I could just use the Install-Package cmdlet.

I have a Windows 10 1511 with latest patches and I run the following commands to enable the chocolatey repository:

Screen Shot 2016-04-11 at 14.21.17

As you can see, when I enter Find-PackageProvider I find the Chocolatey provider and just run the Install-PackageProvider -Name Chocolatey

Screen Shot 2016-04-11 at 14.25.20

Then I need to open a new PowerShell window and can see that the PackageProvider and PackageSource have the Chocolatey records and thus I can now add software from this,

Screen Shot 2016-04-11 at 14.50.35

First I add Firefox and as you can see my PackageSource is not trusted and I get an warning, that can be configured with the Set-PackageSource -Name chocolatey -Trusted

Screen Shot 2016-04-11 at 14.53.06

Have fun with your package management 🙂

Preview of Azure Site Recovery in the new Azure Portal

Finally the Azure Site Recovery service can be reached from the new Azure Portal and the ARM way of doing things! It has been possible to use ASR with PowerShell and the new ARM way for some months but only for a subset of the site recovery services (VMM/Hyper-V).

Screen Shot 2016-04-05 at 14.33.31

Not a day to soon! I have a customer that we have engaged in the CSP program and as that is based on the new, the old ASR was not possible to use with that subscription and use another subscription just for ASR sucks..

As you can see on the following screendump I go into the “Getting Started” to select scenario and then follow the guide to complete and in the case with physical and VMware I need to install a process/configuration server on-premise.

Screen Shot 2016-04-05 at 14.39.29

Once installed on a Windows 2012 R2 server I connect it to the ASR with the registration file,

Screen Shot 2016-04-04 at 14.00.08

One thing to think about using this service is that the process server will if you do not go in and configure the bandwidth settings eat all available internet capacity as my customer so nicely explained…

Configure this to something that works for both you and the company, and with the enhanced ASR where you do not need additional servers in Azure you find this setting in the backup properties.

Screen Shot 2016-04-04 at 23.00.05

It is quite easy to start and protecting your workloads and remember that the first 30 days are free 🙂

 

updated AzureRM PowerShell Module with Export of Resource Group

Today the version 1.3.0 of AzureRM module was released and in that there was a new cmdlet Export-AzureRMResourceGroup that can be used on an resource group and get a json file from that!

updating your AzureRM is quite easy with the powershell gallery repository

Screen Shot 2016-03-30 at 12.13.19

And then you can run the Export cmdlet and get the json file from that deployment and start playing in Visual Studio or VS Code 🙂

Screen Shot 2016-03-30 at 11.43.21

Have fun automating and deploying with Azure Resource Manager!

powershell env:PSModulepath duplicate records Winserv 2016 TP4

I was testing some xAzure DSC configuration stuff on my Windows Server 2016 TP4 and noticed that when I was trying to use the resource it said that duplicate modules was found but I could not find any in the powershell module libraries and thus it ought to be something else,

I found the tweet that Ben Gelens sent pointing me to the $env:psmodulepath

Screen Shot 2016-03-23 at 22.02.29

So looking in my psmodulepath I could see that I had two records that was the same and that had to be fixed,

Screen Shot 2016-03-23 at 14.48.58

So to remove the duplicate I first remove both and then add the one again:

Screen Shot 2016-03-23 at 14.49.52

$env:PSModulePath = $env:PSModulePath –replace “;C:\\Program Files\\WindowsPowerShell\\Modules”

Screen Shot 2016-03-23 at 14.52.54

$env:PSModulePath = $env:PSModulePath + “;C:\Program Files\WindowsPowerShell\Modules”

Happy automating 🙂

SC VMM bare metal deploy with UEFI enabled host

During last week I was working on some bare metal deployment on some Hyper-V hosts with System Center VMM. We had deployed them before using legacy boot but now we had updated the BIOS to latest version and got into some trouble.. Maybe it was because of the HPE instead of the HP 😉

Screen Shot 2016-03-17 at 11.19.02

During the deployment the WinPE got an error and could not connect to the VMM server,

Screen Shot 2016-03-17 at 13.17.02

We tried to update NIC drivers and stuff on the WinPE image but that did not help. During the testing we started the server and configured it to boot with EFI instead of legacy boot and olala it worked to connect to the VMM server but thus as the Hyper-V VHD was MBR we got the following error:

Screen Shot 2016-03-17 at 15.41.29

The easiest way I could think of right there and then was to create my new GPT based VHD to boot the Hyper-V host with a powershell convert script from the original MBR vhd. The script required to be run on a Hyper-V host so I connected to one of the Hyper-V nodes in the test cluster and ran the script on a patched VM that was sysprepped:

Screen Shot 2016-03-17 at 16.02.48

And once that was done I had to update the Physical profile to set the disk to GPT instead of MBR:

Screen Shot 2016-03-17 at 16.23.23

And now the deployment worked nicely all the way!

 

install-service during bootstrap a windows node with chef knife

I was exploring last week how I could add a managed windows node in my internal test environment where I have a chef server.

Bootstrap a windows node has been possible quite a while but not so long ago the knife windows added the parameter for also setting up the client as a service. This was part of the Knife Windows 1.0 release as you can read on the Chef site.

Screen Shot 2016-03-17 at 08.43.37

Another great parameter now available is the –msi_url that gives the possibility to set the chef client msi path to something local if the servers cannot speak to the mighty Internet

happy chef-ing!

Configure VM Network settings from the host using Hyper-V 2016

Today I used Ravikanth script for configuring an VM´s NIC settings from the host and can confirm that it works nicely also on a Hyper-V Host with 2016 TP4 and a full-GUI VM and also with VM´s running Nanoserver 🙂

There is a cmdlet in the Hyper-V PowerShell module that is named: Set-VMNetworkAdapterFailoverConfiguration although that configures only the nic for the Hyper-V replicated VM and cannot be used on a ordinary vm. So using the function from Ravi I set the VM´s configuration using the Hyper-V WMI virtualization namespace.

Screen Shot 2016-03-01 at 14.53.00

And trying to set it on a Nano server also works nicely

Screen Shot 2016-03-01 at 15.19.58