“Hyper-V cannot be installed: A hypervisor is already running” error when trying to install Hyper-V Management Tools in virtualized Windows Server 2012

In certain situations one may want to install only the Hyper-V Management Tools feature in Windows Server 2012 (this includes 2012 R2) rather than the whole Hyper-V role. The most common scenario for this, and the one used in this example, is Windows Server 2012 itself is a virtual machine (VM) running under either Microsoft Hyper-V Server or Windows Server with the Hyper-V role:

Microsoft Corporation Virtual Machine

Since the Windows Server operating system knows the type of underlying hardware, and that in this case it is a hypervisor, trying to add the Hyper-V role via the Add Roles and Features Wizard will not work.

Add Roles and Features Wizard

Add Roles and Features Wizard does not allow one to select to install management tools only in the Add features that are required for Hyper-V? option:

Add features that are required for Hyper-V?

Attempting to install Hyper-V feature on a virtualized Windows Server 2012 will produce the following error: “Hyper-V cannot be installed: A hypervisor is already running.

Hyper-V cannot be installed: A hypervisor is already running.

The simple workaround is to use Windows PowerShell to add the Hyper-V Management Tools feature:

Add-WindowsFeature –name RSAT-Hyper-V-Tools

Reminder: Add-WindowsFeature cmdlet needs to be executed under administrative credentials:

Add-WindowsFeature –name RSAT-Hyper-V-Tools

Posted in How To, Management, Virtualization | Tagged , , , , | 1 Comment

How to install updates in Ubuntu via command line (CLI)

Ubuntu was built to compete with Windows, and as such it includes a lot of features Windows users take for granted. Canonical packaged Ubuntu with the automated process for downloading and installing security and performance updates over an Internet connection, a procedure very similar to Windows Update in Microsoft Windows versions. As an aside, the amount of effort to build this service and the content delivery network (CDN) to distribute the updates is fairly impressive.

While Ubuntu Desktop gives users the option to update the system via the GUI interface — that is generally not an option with Ubuntu Server, as most deployments will run it with command line interface (CLI) only, so included below is the description of the two commands necessary to kick off the Ubuntu update process.

To fetch the list of available updates for your system, enter the apt-get update command via the CLI. Running this command without root superuser privileges will produce a permission denied error.

apt-get update error

Thus you must prefix it with the sudo command:

sudo apt-get update

You will be prompted to enter the password prior to getting the list of updates.

sudo apt-get update password

Run this command periodically to make sure your source list is up-to-date.

sudo_apt-get_update ran

To download and install the applicable updates, enter the apt-get upgrade command via the CLI:

sudo apt-get upgrade

This command upgrades all installed packages.

sudo apt-get upgrade ran

If you look at the upgrade installation results closely, you may notice that 3 packages were not upgraded, but kept back.

sudo_apt-get upgrade kept back

According to Ubuntu manual: “Running apt-get dist-upgrade adds the “smart upgrade” checkbox. It tells APT to use “smart” conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. Please note apt-get dist-upgrade does not perform distribution upgrade.

sudo apt-get dist-upgrade

sudo apt-get dist-upgrade

As you may have noticed from the screenshot in the above example, the apt-get dist-upgrade command did upgrade the three Linux packages that were previously kept back.

While on this subject, here are a couple more package update related apt-get commands:

apt-get autoclean

This command removes .deb files for packages that are no longer installed on your system. Depending on your installation habits, removing these files from /var/cache/apt/archives may regain a significant amount of diskspace.

apt-get clean

The same as above, except it removes all packages from the package cache. This may not be desirable if you have a slow Internet connection, since it will cause you to redownload any packages you need to install a program. The command “du -sh /var/cache/apt/archives” will tell you how much space cached packages are consuming.

Also, these commands were ran in Ubuntu Server 14.04, but the apt-get commands are the same and have not changed going back quite a few versions of Ubuntu.

Posted in How To, Operating Systems | Tagged , , , , | 1 Comment

How to disable Java Update in Windows 7

Anyone dealing with enterprise applications, ends up having to deal with Java. My fate is no different. If you have standardized on using Java platform 6 (jre-6u35 most likely), you have probably noticed that while the Check for Updates Automatically checkbox can be easily unchecked in the the Java Control Panel in Windows XP, in Windows 7 the setting reverts back to the checked state as soon as you close the window.

Java Control Panel

The only solution I have found to resolve this issue, is to edit the Java Update setting in Registry Editor (regedit.exe). In Windows XP the EnableJavaUpdate registry key was located under My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy. It’s a REG_DWORD with 0x0000001 (1) value for enabled, and 0x0000000 (0) for disabled.

Java Update Windows XP Registry Editor

In 64-bit (x64) version of Windows 7 the EnableJavaUpdate registry key is located under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy. It’s a REG_DWORD with 0x0000001 (1) value for enabled, and 0x0000000 (0) for disabled.

Java Update Windows 7 Registry Setting

Changing the setting removed the Update tab from the Java Control Panel in Windows 7.

Java Control Panel Windows 7

Anyone who is running 32-bit (x86) version of Windows 7, will find the registry setting to disable Java update at the same path as it is in Windows XP — Computer\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy.

Windows 7 x86 EnableJavaUpdate registry entry

As previously described, to disable Java updates simply change from 1 to 0 the EnableJavaUpdate registry value.

EnableJavaUpdate edit Registry value

The above example is based on Java Version 7 Update 67.

About Java

The state of the Java Control Panel prior to making the Windows Registry EnableJavaUpdate value change:

Java Control Panel

After the EnableJavaUpdate value is changed:

Java Control Panel without Update tab

Posted in Operating Systems, Utilities | Tagged , , , | 2 Comments

Demise of Fitbit

Just cashed the check I received from the recall center for shipping back my Fitbit Force. According to them: “Because Fitbit received reports of skin irritation from a small percentage of Force users, we have decided to stop sales of Force and conduct a voluntary recall. Fitbit hired independent labs and medical experts to conduct a thorough investigation to identify the potential causes of skin irritation reported by a small percentage of Force users. Some users may be reacting to nickel in the stainless steel used in the device, even though the surgical grade material meets the most stringent regulatory standards. Other users are likely experiencing an allergic reaction to the materials in the strap or the adhesives used to assemble the product.

Fitbit One

I owned three generations of Fitbit activity trackers starting with the very first one. All three died due to water damage. What’s more amazing is that every consecutive model of the device was actually worse in terms of functionality than the previous generation. That is an impressive achievement in the technology business.

What’s seems like a great idea for a product, can easily suffer from poor execution, as well as inadequate customer support. Having to use the “email only” support system on three separate occasions, I walked away severely disappointed every time. The support process always involved having to prove the fact that you were their customer. That is strange when one considers the fact that the products were bought directly from Fitbit.

There are other activity tracking devices on the market now. There is also the upcoming Apple iWatch. But Fitbit truly ruined the experience for me, so I won’t be buying another activity tracker for a while.

Posted in Hardware | Tagged | Leave a comment

How to partition and format disks in Microsoft Hyper-V Server 2012 R2

In Windows, FDisk has been replaced by DiskPart. “DiskPart commands help you to manage your PC’s drives (disks, partitions, volumes, or virtual hard disks). Before you can use DiskPart commands, you must first list, and then select an object to give it focus. When an object has focus, any DiskPart commands that you type will act on that object.” — (Microsoft TechNet).

For example, to create a single primary partition covering the whole second drive, format it as NTFS, label the partition “Virtual Machines” and assign it drive letter E using DiskPart:

list disk
select Disk 1
list partition
create partition primary
list partition
format fs=ntfs label="Virtual Machines" quick
list volume
assign letter=e

For example, to create another primary partition on the first disk using all of the available disk space, format is as NTFS, label it as Temp and assign it drive letter F using DiskPart:

select Disk 0
list partition
create partition primary
format fs=ntfs label="Temp" quick
list volume
assign letter=f

diskpart_list_partition

For example, here’s a script that wipes a disk and then creates a 500 MB partition:

select disk 0
clean
convert gpt
create partition primary size=500
format quick fs=ntfs label="Tools"
assign letter="T"

Use Diskpart /s to run scripts that automate disk-related tasks, such as creating volumes or converting disks to dynamic disks. Scripting these tasks is useful if you deploy Windows by using unattended Setup or the Sysprep tool, which do not support creating volumes other than the boot volume. To create a Diskpart script, create a text file that contains the Diskpart commands that you want to run, with one command per line, and no empty lines. You can start a line with REM to make the line a comment.

When using the DiskPart command as a part of a script, we recommend that you complete all of the DiskPart operations together as part of a single DiskPart script. You can run consecutive DiskPart scripts, but you must allow at least 15 seconds between each script for a complete shutdown of the previous execution before running the DiskPart command again in successive scripts. Otherwise, the successive scripts might fail. You can add a pause between consecutive DiskPart scripts by adding the timeout /t 15 command to your batch file along with your DiskPart scripts.

When DiskPart starts, the DiskPart version and computer name display at the command prompt. By default, if DiskPart encounters an error while attempting to perform a scripted task, DiskPart stops processing the script and displays an error code (unless you specified the noerr parameter). However, DiskPart always returns errors when it encounters syntax errors, regardless of whether you used the noerr parameter. The noerr parameter enables you to perform useful tasks such as using a single script to delete all partitions on all disks regardless of the total number of disks.” — (Microsoft TechNet).

To run a DiskPart script, at the command prompt, type the following command, where scriptname is the name of the text file that contains your script:

diskpart /s scriptname.txt

To redirect DiskPart’s scripting output to a file, type the following command, where logfile is the name of the text file where DiskPart writes its output:

diskpart /s scriptname.txt > logfile.txt
Posted in How To, Management, Virtualization | Tagged , , | 1 Comment

How to add or remove a local user account to a local group in Microsoft Hyper-V Server 2012 R2

The simplest way to add a local user account to a local group in Microsoft Hyper-V Server 2012 R2 is using the NET command:

NET LOCALGROUP "group" "username" /ADD

To remove a local user account from a group:

NET LOCALGROUP "group" "username" /DELETE

net_localgroup_add_del

Posted in How To, Management, Virtualization | Tagged , , | Leave a comment

How to create or delete a local user account in Microsoft Hyper-V Server 2012 R2

The simplest way to create or add a local user account in Microsoft Hyper-V Server 2012 R2 is using the NET command:

NET USER username "password" /ADD

To delete or remove a local user account:

NET USER username /DELETE

net_user_add_del

Posted in How To, Management, Virtualization | Tagged , , | Leave a comment

How to enable Remote Desktop (RDP) access in Microsoft Hyper-V Server 2012 R2

Out of the box, Remote Desktop access is disabled in Microsoft Hyper-V Server 2012 R2. This post provides a quick overview of the steps necessary for enabling RDP access to Hyper-V Server.

remote_desktop_disabled

Option 7 in the Server Configuration menu provides a simple way of enabling Remote Desktop access:

(E)nable or (D)isable Remote Desktop? (Blank=Cancel)
1) Allow only clients running Remote Desktop with Network Level Authentication (more secure)
2) Allow clients running any version of Remote Desktop (less secure)

rdp_enabled

Selecting these options is not enough to enable Remote Desktop access — firewall rules must be changed as well. Running the following command from the command line will change the firewall rules:

netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes

netsh_firewall

Posted in How To, Management, Virtualization | Tagged , , , , , | Leave a comment

“No active network adapters found” warning in Microsoft Hyper-V Server 2012 R2

The previous article provided a step-by-step screenshot guide of the Microsoft Hyper-V Server 2012 R2 installation process. After the setup process was finished, a warning window popped up while the Server Configuration text-based menu was loading:

Warning – No active network adapters found.

16_no_active_adapters

While this warning message will pop up anytime there is no physical network connection during the startup of sconfig.cmd, in this particular case, the network adapter is present and a patch cable connects it to the network switch, as the link lights on both the NIC and the switch clearly indicate that a physical network connection has been made. Given that information and considering that Hyper-V Server was just setup — we can safely assume that it is simply missing the driver for this particular network adapter.

Hardware support and compatibility is where Hyper-V Server shines because of its Windows-based driver model, as opposed to VMware vSphere Hypervisor which takes the strictly certified hardware approach. To resolve the “No active network adapters found” warning in Microsoft Hyper-V Server 2012 R2, we simply need to load the missing network interface card (NIC) driver. The driver package can be downloaded from the manufacturer’s website on another computer and the files extracted to a USB flash drive. It’s great to see that upon plugging-in the USB flash drive into the system that Hyper-V Server mounts it and assigns it a drive letter just like any Windows system would.

option_14

To install the driver in Hyper-V Server 2012 R2 (or any Windows Server Core setup) Microsoft provides PnPUtil (PnPUtil.exe) command line tool that lets an administrator add or delete a driver package to the driver store, and enumerates the driver packages that are currently in the driver store. PnPUtil (PnPUtil.exe) is included in every version of Windows, starting with Windows Vista (in the %windir%\system32 directory).

PnPUtil -i -a Drive:\Path\Filename

pnputil_completed

Filename can specify the name of a single INF file, and names of all INF files, or only specific INF files by using the asterisk (‘*’) or question mark (‘?’) wildcard characters. To enumerate the driver packages that are currently in the driver store:

PnPUtil -e

Only driver packages that are not in-box packages are listed. An in-box driver package is one which is included in the default installation of Windows or its service packs.

Posted in Networking, Operating Systems, Virtualization | Tagged , , | 1 Comment

How to install Microsoft Hyper-V Server 2012 R2 step-by-step

This post provides a quick step-by-step walkthrough of installing Microsoft Hyper-V Server 2012 R2, the free bare-metal version of Microsoft’s hypervisor, that directly competes with VMware vSphere Hypervisor 5.5. At this point Microsoft Hyper-V can be considered mature technology, so one should not be surprised to see it gain some traction within the enterprise in the near future.

As illustrated by the screenshots below — the setup process is very straightforward. The only selections made during the installation process [other than the localization settings] were the disk and partition options. As a rule of thumb a 32 GB partition is more than enough space to run Hyper-V Server (350 MB System Reserved partition was created automatically during the setup process). After the installation completed, operating system and related files took up about 11 GB of disk space.

01_loading_files 03_localization

04_install_now 05_license_terms

06_install_type 07_where_to_install

08_create_32gb 09_partitions

10_progress 11_restarting

12_getting_ready 13_password_must_change

14_password_change 15_password_changed

16_no_active_adapters 17_sconfig

As you may have noticed from the screenshots, a warning window popped up while the Server Configuration text-based menu was loading:

Warning – No active network adapters found.

Since in the case of this particular system, the adapter is present and a patch cable connects it to the network switch (link lights on both the NIC and the switch clearly indicate that a physical network connection has been made), we can safely assume that Hyper-V Server is simply missing the driver for this particular network adapter. Read more about this issue in my next article

Posted in How To, Virtualization | Tagged , , | Leave a comment