TechShizz | All posts tagged 'HyperV'

Windows machine/server stuck in reboot loop

Problem

Windows machine/Server stuck in acontant loop and will not boot into OS

Solution

There is a couple of other options, but we have to go to Command Prompt. So, click on it and it will open up cmd.exe as administrator.

advanced options cmd

Now, we are going to restore the registry. We have seen the reasons for this issue and one of the reasons is a change in registry. So, let’s restore the register to its original state.

Go to C drive by writing C: .

After that we have to go to CD WindowsSystem32.

After that type in CD config.

Now we want to see the files here. Type in DIR and click Enter.

cmd dir

As you can see there is a folder RegBack, go into that folder with CD Regback.

As you can see, there are 5 files (DEFAULT, SAM, SECURITY, SOFTWARE and SYSTEM). These are the registry backups.

cmd regback

Now, go back to the config folder by writing CD.. . After that, type in DIR to see the files in that folder. As you can see now, there are 5 files with the same names. But there is a difference. The files in RegBack folder is for backup, and the files in the config folder are using now.

So, we just need to replace files in the config folder with files from the RegBack folder. But we don’t want to delete files from the config folder, because it’s safer to just rename them. Let’s do it.

You can rename DEFAULT file by writing REN DEFAULT DEFAULT1. It will rename DEFAULT file into DEFAULT1. Do the same thing with the other 4 files.

cmd regback rename

So, once all these files have been renaming, we are going to copy these 5 files from the RegBack folder to the config folder.

Type in CD RegBack to go to the RegBack folder. Now we have to copy all files to the config folder, so just type in COPY * C:WindowsSystem32config.

cmd regback copy

Now go to the previous directory and type in DIR. As you can see, we did it properly, so type in EXIT.

 http://theitbros.com/fix-your-pc-ran-into-a-problem-and-needs-to-restart/ 

How to convert .VMDK to .VHD or .VHDX

First, download the Microsoft Virtual Machine Converter:

Next run powershell as administrator and run the following commands.

  • Import-Module ‘C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1’
  • ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath “C:\Ubuntu-disk1.vmdk” -DestinationLiteralPath “C:\Ubuntu-disk1.vhd” -VhdType DynamicHardDisk -VhdFormat Vhd

Nested Hyper V in VmWare

To run Hyper-V in VMWare you need to edit the .vmx file and append the following to allow a hyper visor to be virtualised.

hypervisor.cpuid.v0 = “FALSE”

mce.enable = “TRUE”

vhu.enable = “TRUE

Hyper V Replicas (non Clustered)


A Hyper V Replica provides a form of high availability which is useful in inter-site failover situations. Failover clusters generally operate in a single site - however if that site is compromised by a natural disaster or a major incident, then the service would fail.

 

With a replica, the VM can be trickled to another site, and in the event that failover is required the service can keep running with a recent copy of the source VM.

 

  1. Go to the settings of the Hyper V host that will hold the replica > Go to Replication Configuration
    1. Click Enable this computer as a replication server
    2. In a production environment, certificates should be used to configure the transfer of the vhd/x file over SSL. A suitable certificate needs to be issued from the company CA and imported into the personal store of both the Primary and the replica server. Also this method allows the replication to another domain even if it's untrusted.
    3. Configure the Authorization and storage section. Allow replication from specified servers and also the location the VHDX file will be stored on the replica machine.
    4. Repeat this on the primary machine
  2. Go to the Firewall and enable "Hyper-V Replica HTTP Listener (TCP-In)" or the HTTPS Version depending on method. This needs to be configured the same on both the primary and the replica server to allow failback.
  3. On the primary server, right click on the VM and click "Enable Replica". Follow the wizard.
  4. Remember that the VMs are likely to be on different subnets, so this needs to be configured in the TCP/IP settings of the VM (not the HV Host) so that when the VM fails over its IP address changes accordingly.

 

This feature can be configured in a daisy chain so that if the replica fails, another replica of that can then take over in a 3 site scenario (or more).

Network Isolation

A VM can be isolated from one or more IP addresses or MAC addresses using the following powershell command.

 

Add-VMNetworkAdapterAcl-VMName VM1 -RemoteIPAddress 192.168.0.99 -Direction Both
-Action Deny

You can also meter the amount of data transefered by using the following:

 

Add-VMNetworkAdapterAcl-VMName VM1 -RemoteIPaddress 192.168.0.99 -Direction Both
-Action Meter

 

To verify the change or check and existing VM isolation type or meter:

 

Get-VMNetworkAdapterACL -VMName VM1