Refresh ENVironment Variables

The „refreshenv“-CMD/Powershell-Command updates all Environment-Variables e.g. after installing a new software package.

C:\WINDOWS\system32>refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..

Windows Client Setup: Disable Teredo/ISATAP

Both Protocols are absolutely useless for all common use-cases, but enabled – just „providing“ potential security issues.

Disable like this:

netsh interface isatap set state disabled
netsh interface teredo set state disabled

Cloud-Init for VMs in private and public Clouds

Initialize VMs in a vSphere private Cloud using Cloud-Init

Cloud-Init Datasource for VMware GuestInfo is deprecated

The Web is full of explanations, how to use „Cloud-Init Datasource for VMware GuestInfo“ but https://github.com/vmware-archive/cloud-init-vmware-guestinfo it is deprecated.

It is now integrated natively into Cloud-Init

Cloud-Init 21.3 has been released https://discourse.ubuntu.com/t/release-of-cloud-init-21-3/23857 which integrates this software.

New name:

I’d expect it to be in the current Ubuntu 21.10 (Impish Indri) https://cloud-images.ubuntu.com/impish/current/ – the release notes for 21.10 don’t specify the exact version.

Ubuntu 20.04 (Focal Fossa) is still at cloud-init 20.1-10 according to https://wiki.ubuntu.com/FocalFossa/ReleaseNotes which is too old.

Prepare a VM-Template

Unfortunately Ubuntu provides the „cloud“-images in OVA-Format.

Create VM-Template from OVA

Deploy

  • impish-server-cloudimg-amd64.ova

as

  • VM
  • keep all settings set to default

Customize VM

  • disable (or remove) the „Serial“-port
  • disable vApp-Properties
    • those would break the cloud-init process later on
    • VM=>Configure
    • Settings=>vApp-Options
    • disable [ ] vApp-Properties

Convert to Template

  • VM-Template „ubuntu-impish-21.10-cloudimg“.

Clone a VM from this VM-Template

This shouldn’t be done manually, I’d suggest using terraform

Verify that Cloud-Init 21.3 is available and the „VMware“-Datasource is included

Cloud-Init Version

Release 21.3 is available:

ubuntu@ubuntu:~$ cloud-init --version
/usr/bin/cloud-init 21.3-1-g6803368d-0ubuntu3

Check the Cloud-Init Datasource

Datasource „vmware“ is included:

ubuntu@ubuntu:~$ cloud-id
vmware

Enable ESXi-Host as VNC-Server to access a vSphere-VM remotely

I prefer accessing VMs using SSH or RDP directly. Sometimes, the IP-Address of the VM isn’t reachable, or protocols for remoteaccess need to be disabled for security reasons.

In these cases, if an IP-connection to the ESXi-Server is available this could be an option to use the ESXi hypervisor as VNC-Server to provide access to VM keyboard, video, mouse…

Three VM advanced Configuration Parameters need to be set:

  • „password“ is optional, but mRemoteNG as VNC-Client doesn’t work without password set.
RemoteDisplay.vnc.enabled = TRUE
RemoteDisplay.vnc.port = <TCP-Port>
RemoteDisplay.vnc.password = <Passwort>

MS Word – stop adding spaces when pasting text

I hate it 😉 Just want to paste some text, but word adds spaces before, never found a use-case for this default.

Easy to change:

  • File=>Options=>Advanced
  • Cut, copy and paste=>Use smart cut and paste => Settings
  • [ ] Adjust sentence and word spacing automatically

Thank you for the option to turn this off!

Update Terraform and vSphere-Provider

Terraform is a single .EXE-File so installation is about adding it’s folder to the $PATH-Variable and upgrading is about replacing „terraform.exe“ by the current version.

Update Terraform

C:\RH\LAB\TERRAFORM\vSphere_N9K>terraform --version
Terraform v0.15.2
on windows_amd64

Your version of Terraform is out of date! The latest version
is 1.0.11. You can update by downloading from https://www.terraform.io/downloads.html

C:\dir "c:\Program Files (exe)"\terraform*.*
 Volume in drive C is Windows
 Volume Serial Number is 583C-0C08

 Directory of c:\Program Files (exe)

05.05.2021  22:34        81.442.168 terraform.exe
               1 File(s)     81.442.168 bytes
               0 Dir(s)   8.344.129.536 bytes free

Download the current release („terraform_1.0.11_windows_amd64.zip“) unzip it and copy it to the correct destination:

C:\>dir "c:\Program Files (exe)"\terraform*.*
 Volume in drive C is Windows
 Volume Serial Number is 583C-0C08

 Directory of c:\Program Files (exe)

12.11.2021  17:41        60.838.776 terraform.exe
05.05.2021  22:34        81.442.168 terraform.bak

               2 File(s)    227.786.808 bytes
               0 Dir(s)   8.344.129.536 bytes free

C:\terraform --version
Terraform v1.0.11
on windows_amd64

Update vSphere-Provider

Using this „.tf“-File referencing the „hashicorp/vsphere“-Provider:

terraform {
  required_version = ">= 0.13"
  required_providers {
    vsphere = {
      source  = "hashicorp/vsphere"
    }
  }
}

and initialize the project with current provider(s):

C:\>terraform init -upgrade

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/vsphere...
- Installing hashicorp/vsphere v2.0.2...
- Installed hashicorp/vsphere v2.0.2 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.


Old Firefox Stable for Admins

This is not for general usage, but an „admin-Jumphost“-computer/vm which needs to get flash enabled from time to time and is never used for public internet browsing…

There it might be an un-dogmatic solution to install the last Firefox 78.15 ESR Release.

Find it here: https://ftp.mozilla.org/pub/firefox/releases/78.15.0esr/win64/de/

Disable Auto-Update

That’s easy

  • Firefox Settings => Update Settings => „Disable Automatic Updates“

Disable Update-Notification

That’s harder – Firefox guys (think to) know better what’s good for their users and they don’t even provide an „about:config“-switch: fail!

Add the following registry Key:

HKEY_LOCAL_MACHINE\Software\Policies\Mozilla\Firefox

Add the following 32-Bit DWORD

DisableAppUpdate

with value set to

1

and restart Firefox.

Windows CCM Cache eats diskspace

Don’t delete the content of „c:\windows\ccmcache\“ manually with the File-Explorer:

  • it is managed by „Windows System Center Configuration Manager (SCCM)“.

You need „local Administrator“ access to your computer.

Let SCCM to cleanup it’s cache for you:

1) open the „Control Panel“

Control Panel – Configuration Manager

2) select „Configuration Manager“

3) go to „Cache“-Tab

4) click „Delete Files“

Configuration Manager – Delete Cache

Wait a second and the CCM-Cache is empty.

c:\Windows\ccmcache>dir
 Volume in drive C is Windows
 Volume Serial Number is 5Q4C-0K08

 Directory of c:\Windows\ccmcache

23.09.2021  19:10    <DIR>          .
23.09.2021  19:10    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  11.164.721.152 bytes free