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 , , , | Comments Off

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 | Comments Off

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=300
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 , , | Comments Off

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 , , | Comments Off

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 , , | Comments Off

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 , , , , , | Comments Off

“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 , , | Comments Off

Microsoft Hyper-V vs. VMware vSphere update

A while ago, it was suggested to me to never discount Microsoft’s ability to innovate, or their business savvy. Time after time Microsoft has introduced products into a space with an obvious market leader, yet it’s Microsoft’s products that we use today. Here is a quick reminder of a few famous bouts they have fought:

  • Word Processor: WordPerfect vs. Word
  • Spreadsheet: Lotus 1-2-3 vs. Excel
  • Database: dBase vs. Access
  • Browser: Netscape vs. Internet Explorer
  • Network Operating System: Novell NetWare vs. Windows NT

Just a couple of years ago VMware seemed to be the clear leader in the virtualization space. Today the picture is somewhat different, as Microsoft clearly has VMware in its sights:

  • Desktop: VMware Workstation 10 vs. Microsoft Windows 8.1 Professional/Enterprise
  • Server: VMware vSphere 5.5 vs. Microsoft Windows Server 2012 R2 Standard/Datacenter
  • Free: VMware vSphere Hypervisor 5.5 vs. Microsoft Hyper-V Server 2012 R2

Feature-for-feature Microsoft’s Hyper-V is now on par, or arguably has already surpassed VMware’s hypervisor, especially if the guest OS being virtualized is Windows 2012. From a hardware standpoint Microsoft offers much broader support, but what’s more interesting is the licensing strategy and the positioning of its products.

Remember good old Microsoft Office? It bundles Word, Excel and Access into one convenient and easy to purchase license. Bundling and integration is the nature of the game here. On the desktop end, we now have the ability to virtualize, as well as use Hyper-V management tools, by simply adding the Hyper-V feature in Windows 8.1 Professional/Enterprise – no additional licensing required. [So there is definitely no need to license a copy of VMware Workstation.]

On the server end, getting into virtualization is once again as simple as adding the Hyper-V role to Windows Server. Microsoft also threw in a licensing bonus here. Windows Server 2012 R2 Standard includes two virtualized Windows Server 2012 R2 licenses, and Windows Server 2012 R2 Datacenter includes unlimited number of virtualized Windows Server 2012 R2 licenses. Licensing costs are definitely something most enterprises will be looking at.

Finally there is the free tier of both Hyper-V and vSphere hypervisors, which is actually being heavily utilized by many smaller companies. Microsoft presents Hyper-V Server 2012 R2 as the solution for desktop virtualization or VDI. It does not bundle any server licenses, nor does it include the basic management interface (management is either via PowerShell, or via console tools running on a Windows 8.1/Windows Server 2012 R2 box). As such you are expected to license each guest OS separately, while the host hypervisor is completely free. This is on par with VMware’s vSphere Hypervisor 5.5 offering.

VMware is clearly seeing the shots across its bow, as of the current writing the limitation of 32GB RAM limit per server/host has been removed from the free hypervisor. It now also supports unlimited number of cores per physical CPU, and unlimited number of physical CPUs per host. On the VM level Microsoft Hyper-V seems to be technically more capable, although one is not certain how likely we are in the real world to encounter such limits as virtual CPUs per VM (64 vs. 8), memory per VM (1TB vs. 32GB), or active VMs per Host (1,024 vs. 512).

A couple of features Microsoft Hyper-V Server 2012 R2 offers that VMware vSphere Hypervisor 5.5 does not, are clustering and nothing-in-common live migration. Add to that the fact that the virtual machine image format (VHD) is the same as the one utilized by the Azure cloud offering, and things are starting to get very interesting. Of the top of your head can you name the company behind dBase? Wondering if anyone will be able to name the company behind vSphere 15 years from now?

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