The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,867 other followers

Archive for the ‘VMware’ Category

When some virtual machines cannot run VMware Tools: Graceful shutdown of an ESXi 5.1 host and guest VMs (free edition) using the shell/command line/scripting (UPS friendly)

Posted by jpluimers on 2022/04/12

An interesting set of scripts from [Wayback/Archive.is] No Joke IT: Graceful shutdown of an ESXi 5.1 host and guest VMs (free edition) using the shell/command line/scripting (UPS friendly).

If all ESXi virtual machines support running of VMware Tools, then the solution is a plain /sbin/shutdown.sh && /sbin/poweroff (see [Wayback/Archive.is] No Joke IT: Shut down ESXi 5.1 guest VMs and the host (free edition) via SSH – the easy way!).

Code is in the repository at [Wayback/Archive.is] sixdimensionalarray/esxidown: A shell script to shutdown VMware ESXi host servers, with these two main files:

Note: the No Joke IT web-site has vanished, so only the [Wayback] and [Archive.is] links of it still work. The github code was still there at the time of writing.

Via: [Wayback] Solved: Read only Files – VMware Technology Network VMTN

Related: Some notes on replacing parts of a text file with template text using sed on a Busybox system.

–jeroen

Posted in *nix, *nix-tools, ash/dash, ash/dash development, Development, ESXi5, ESXi5.1, ESXi5.5, ESXi6, ESXi6.5, ESXi6.7, Power User, Scripting, Software Development, Virtualization, VMware, VMware ESXi | Leave a Comment »

windows xp – How to know which license version has an XP installed system – Super User

Posted by jpluimers on 2022/03/29

When virtualising your final physical Windows XP machines (just in case you need to hook up old hardware that is unsupported from newer Windows versions), you need to figure out the kind of license of each physical Windows XP machine in order to stand a chance to keep it licensed.

This answer by [Wayback] Moab [Wayback] windows xp – How to know which license version has an XP installed system – Super User helped me a lot.

I tried to make it a bit easier to read:

  1. First obtain the “Product ID” from the Windows XP machine. It is derived from the original Windows XP installation product key and displays a few values:

    xxxxx-yyy-zzzzzzz-zzzzz

    • xxxxx: the MCP (Microsoft Product Code) describing which product version, or in case of Windows XP: what language, edition (like “Home” and “Pro”) and often some more information)
    • yyy: the Channel ID (especially important to set apart OEM from other channels; OEM is not allowed to be virtualised, so would need a complete new Windows XP key to be activated as Virtual Machine; Channel IDs being neither OEM nor VLK (volume license key) can often be re-activated, sometimes over the phone to explain the situation; I’ve not tried virtualising a VLK based Windows XP yet.
    • zzzzzzz-zzzzz: semi-random values

    [Wayback/Archive.is] Product IDs – Lunarsoft Wiki has quite detailed lists of not just the MCP and Channel ID values for Windows XP and Windows Server 2003, but also the disk volume labels and setup.ini label values.

    Often this is easier to do from the physical machine before virtualising it, but even afterwards you can get it by running Windows in Safe Mode, then use either of these to get the Product ID:

    1. Run the Windows Contol Panel applet sysdm.cpl which shows the “Product ID” us under the “Registerd to” information.
    2. From the console, run reg query "hklm\software\microsoft\windows nt\currentversion" /v ProductID
    3. From another machine or boot CD (like Hiren’s Boot CD or Windows Ultimate Boot CD), mount the hard disk, mount the registry hive, then show the above registry key value
    4. Download and run NirSoft [Wayback] ProduKey (which usually will give you both the Product ID and Product Key)
  2. From the product key, determine if you can re-activate Windows, either by phone, or by this link:

    [Archive.is] Self Service for Mobile

    I got the link from [Wayback] activate windows xp – Microsoft Community via [Wayback] windows xp – How do I activate WindowsXP now that support has ended? – Super User.

    Phone (in most countries) and on-line activation should still work; it worked in 2016 (see [Wayback] license – Will I still be able to activate Windows XP after support ends? – Super User) 2019 (see [Wayback] windows xp – How do I activate WindowsXP now that support has ended? – Super User) and 2020 (see [Wayback] XP activation – Windows XP Home and Professional).

  3. When OEM, try to obtain a legal Windows XP license key that matches the MCP, then change the key using steps in for instance:

    Note that it is no use searching Google for Windows XP License keys: Microsoft did and invalidated them back in the Windows XP SP1, SP2 and SP3 days: Wayback: Error message when you install Windows XP Service Pack 1 (SP1) or Service Pack 2 (SP2): “The product key used to install Windows is invalid

     

The 2001 Windows XP Professional License is archived in the Wayback machine as Microsoft Windows XP Professional END-USER LICENSE AGREEMENT: Windows%20XP_Professional_English_9e8a2f82-c320-4301-869f-839a853868a1.pdf (via [Wayback] Convert your existing Windows XP system into a virtual machine – TechRepublic).

Note this does not cover OEM or Volume Licenses.

–jeroen

Posted in ESXi6, ESXi6.5, ESXi6.7, Power User, Virtualization, VMware, VMware ESXi, Windows, Windows XP | Leave a Comment »

Some links on USB pass-through for ESXi

Posted by jpluimers on 2022/03/23

For my link archive (especially because when disconnecting USB devices, the path value needs to be uber-correct, while for connecting, the path value only needs to be a partial match):

Commands applicable:

  • lsusb
  • the /var/log/vmkernel.log file filtered on usb (in a case insensitive way)
  • vim-cmd vmsvc/device.getdevices
  • vim-cmd vmsvc/device.connusbdev
  • vim-cmd vmsvc/device.disconnusbdev

–jeroen

Posted in ESXi6, ESXi6.5, ESXi6.7, Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

Stop 0x0000007B after converting an existing XP machine to a Virtual Machine (ESXi, Hyper-V, or other)

Posted by jpluimers on 2022/03/22

In 2015, I posted P2V of an existing XP machine to Hyper-V to have an emergency fallback when retiring old XP physical machines and did a short edit on 20210727 promising about a future article on trying to fix the [Waybackstop 0x0000007B blue screen.

This stop can that can happen during boot when the converted Windows XP requires different disk drivers than the physical Windows XP. Windows Vista and up are smarter to figure out the required changes, but Windows XP wasn’t.

The above screenshot is actually from the same physical Windows XP machine after doing the conversion, I wanted to try and run the virtual machine on physical hardware close to the original before moving it to the actual VMware host (yup, the Windows XP machine had been used as a VMware host before, so it had both VMware Workstation 6.5 and VMware Converter 4.01 installed).

The reason I wanted to move my last Windows XP machine to a virtual machine was that it was the only computer that could still print to my old, but nice, Olympus P-400 color dye sublimation printer. I mentioned this in 2015 when Installing the PIXMA mini260 – Canon Europe drivers under Windows 8.1 x64 – trying to say goodbye to Windows XP

I need to find a way to get my [Wayback/Archive.is] Olympus Camedia P-400 Digital Color Photo Printer. That is a lot harder: the latest Windows [Wayback] P-400 Printer > Software Downloads are for Windows XP.

At the end, of the blog post are a few links on the stop 0x0000007B and the Universal Boot CD for Windows workaround.

Read the rest of this entry »

Posted in Fusion, Hyper-V, Power User, View, Virtualization, VMware, VMware Converter, VMware ESXi, VMware Workstation, Windows, Windows XP | Leave a Comment »

Some notes on replacing parts of a text file with template text using sed on a Busybox system

Posted by jpluimers on 2022/03/17

Note before you think about putting stuff in /etc/rc.local.d/local.sh: that script will not be executed when UEFI booting.

In a very lightweight Busybox system, I wanted to modify some configuration files automatically using fragments stored in template files.

The system has diff, but no patch.

The basic idea is to use sed to insert the template files into certain spots of the configuration file when certain marker texts are not present. So I want the opposite of [Wayback] Hey Stephen Wood: Try patch instead of sed in shell scripts.

Basically the idea is a poor-man’s patch, described in Too bad: ESXi busybox has diff, but not patch « The Wiert Corner – irregular stream of stuff.

Some links that might help me with this:

One alternative would have been to use ed (which is part of the normal Busybox), but ESXi Busybox omits ed like it omits patch.

Too bad that sed commands are too different from ed commands, as I could have used diff -e on another system based on ideas here:

I might give it one more go, as vi is sort of derived from ed via ex (see vi: Creation – Wikipedia), which means that vi “colon mode” (officially command mode: [Wayback] Vim documentation: cmdline) is very similar to ed.

Another alternative would be awk, but I have done so little work with it awk, that I’m hesitating to use a new tool. Some links:

And finally, ash could be used:

The kind of modifications I am after

Below are a few links with examples of the kind of modifications I want to make. Most patch just /etc/rc.local.d/local.sh, but some others introduce other changes as well.

Note that especially with networking settings, local.sh commands might not have any effect (for instance when having slow DHCP or other network issues), see for instance [Wayback/Archive.is] I’m running ESXi 5.5 and my persistent route in local.sh is not taking effect after boot. : vmware.

There is a very convoluted way around using local.sh by using the VIB authoring tool as described in [Wayback] How to create persistent firewall rules on ESXi. It requires lowering the software acceptance level to Community Supported (esxcli software acceptance set --level=CommunitySupported), which gives you a hard time installing ESXi updates.

I got that VIB idea from [Wayback] Solved: Re: Persistent firewall rule – VMware Technology Network VMTN, as:

The local.sh file gets overwritten often with upgrades so it would mean another step during the process.

From the same thread comes [Wayback] Solved: Re: Persistent firewall rule – VMware Technology Network VMTN

set the sticky bit on your separate xml-file – then it will be backed up and persist through reboot: chmod +t

run backup manually before the first reboot: /sbin/auto-backup.sh  because backup runs only once per hour

Within vSphere, one could use [Wayback] Configure ESXi Hosts with Host Profiles, but a standalone ESXi box is not part of vSphere, so that won’t work.

ESXi 7 and up

ESXi 7 makes the above harder as for instance user root cannot change file rights any more, so eventually I might revert to a VM that auto-boots when ESXi comes up, then patches the right files in place over PowerCLI (read-only) or SSH.

Need to give this some thought later:

–jeroen

Posted in *nix, *nix-tools, ash/dash, ash/dash development, Awk, BusyBox, Development, ESXi6, ESXi6.5, ESXi6.7, ESXi7, Power User, PowerCLI, Scripting, sed, sed script, Software Development, Virtualization, VMware, VMware ESXi | Leave a Comment »

 
%d bloggers like this: