Windows server 2019 setup quirks

Ran into some issues when upgrading or installing a new 2019 server. Some of the problems are consistent, others may or may not happen.

Network – upgrade.

IPV4 settings are transferred but IPV4 protocol is not enabled on the NIC, only IPV6 is enabled. You have to manually enable IPV4 then it will work.

If it previously had remote desktop access, the firewall will block it. However, the firewall will show access is allowed when looking at permitted apps rather than advanced security. Run admin command line to enable remote desktop thru the firewall.
Enable-NetFirewallRule -DisplayGroup “Remote Desktop”

File and Printer sharing for Microsoft networks is turned off on the NIC. If the machine was a print server or file server, it will not function as such. All other file and print settings are retained in the upgrade so you only need to check the box and function is restored.

In a new install, the GUI activation for a MAK is broken and always returns an invalid key error. Probably the same in upgrade. You have to enter the key from the admin command console or Powershell  using:
slmgr – ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Hyper-v. The external connected virtual switches are changed to internal connection. I just created a new virtual switch with external connection and replaced the old ones.

Hyper-v. Virtual machines may not boot. Failing after a series of short multiple attempts. The problem is known and the work around is to change the MAC address on the virtual machine. If it’s dynamic, switch to static AND change the MAC address. Just 1 digit is enough. You can change back later.

How to setup a kiosk on a Raspberry Pi ver. 1.2 June 2022

This produces a full screen display of a web site that users cannot modify but Chrome is not in kiosk mode. This makes it easy for admins to remotely modify the display as things change.

These instructions are similar for the Ubuntu 18.0.4 OS. Some steps are easier since they are available from the GUI. A few changes need to be made though. The desktop needs to be changed to lightdm to reduce complexity of setting up a running X11VNC on startup. Automatic login on boot, adding startup programs and stopping the screen saver are available in the GUI. No need to start SSH; it’s already on. The chromium startup line also need the additional switch: --password-store=basic This bypasses an extra chromium login on startup.

When using an existing box, the chromium browser may not work properly for this on older versions of Jessie.
Update the OS and it’ll work as it should.
sudo apt-get update
sudo apt-get dist-upgrade

Install Raspbian OS from web site
Default is to boot into GUI desktop without using a password

Activate SSH connection
SSH has been deactivated by default since 2016

https://raspberrypi.stackexchange.com/questions/33431/connect-to-raspberry-pi-over-ssh-connection-refused-from-putty

set keyboard layout to match your locale.   Default is UK. This can cause problems with passwords having a special character when trying to connect with putty. Get access denied because passwords don’t match as the keyboards are not mapped the same. Found out the hard way.

——————————————————————————————————————————–
Permanently disable screen blanking, allow SSH, disable built in  VNC

Now controlled under raspi-config app in terminal mode
or
from GUI select preferences>Raspberry Pi configuration.

Blanking: Select display tab and turn off screen blanking
SSH: Select interfaces tap and activate
VNC: Make sure it is not turned on.

check that SSH is active netstat -lt
SSH port will show in list if it’s active.

——————————————————————————————————————————

Install and configure the x11 VNC.
This shows the active GUI instead of spawning a new one. You can see the changes that will appear on the display screen. This allows you to use ctl + or ctl – to change font size and leave it set when you disconnect.

RealVNC server is installed on the raspberry pi and turned off by default. Do not turn it on. Doing so will result is multiple competing processes and you will be unable to connect.

I used UltraVNC to connect from the windows machine. It does not require a vendor account and email address.

https://www.megaleecher.net/Raspberry_Pi_VNC_Setup

sudo apt install x11vnc

Configure autostart for VNC in:  /home/[user]/.config/autostart/x11vnc.desktop
create the file and directory if it does not exist

File contents:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNCx11
Exec=x11vnc -forever -usepw
StartupNotify=false
Terminal=false
Hidden=false

additional line to prevent errors at startup. Sometimes the browser starts before the network is finished configuring so you get errors in connection. I haven’t seen it in the latest OS version but has happened in the past
X-GNOME-Autostart-Delay=3

Create password for remote session. This is separate from the user login password, but the same password can be used in both.
x11vnc -storepasswd

reboot to start x11vnc

Set the browser to open full screen when the system boots into the GUI. Incognito mode is needed because of the way some web sites change between modes. Failure to go incognito may prompt for a user response.

Use systemd autostart configuration for the browser.
cd ~/.config/autostart
sudo nano browser.desktop
[Desktop Entry]
Type=Application
Name=browser
Exec=/usr/bin/chromium-browser --start-fullscreen --incognito http://yoursite
Note:
some browsers display the double hyphen as a single dash.
Check https://peter.sh/experiments/chromium-command-line-switches/ for correct style if in doubt

To display a web page with mixed secure and unsecure content.
add the switch. --allow-running-insecure-content 

Note: Advanced settings in chrome allow mixing secure and unsecure content from specific websites. Privacy and Security > Site Settings > Additional content settings > Insecure content > Allow > add
However, this is not applied when starting from a command line in the autostart

You can now disconnect the keyboard and mouse. The unit will boot into a full screen display of the web site and the users cannot modify the settings. You can remote in and change the display easily. Patience on startup. The web site may take 30 seconds to appear and fully display. Usually less but it varies by website.

———————————————————————————————————————————Allow remote user to reboot the display
Create user account; I use reset as the user name.
In /etc/sudoers.d create a file with the following line.  File name doesn’t matter; I use reset-display.

reset ALL=NOPASSWD: /sbin/reboot

This allows the named user to run the reboot command without sudo privileges.
To do it remotely from a windows environment, install Putty and use the Plink utility to send the reboot command to the box.

plink reset@192.168.1.100 -pw password sudo reboot

sudo will run without an admin password because of the file created in sudoers.d

Include it in a .bat file with an exit command and you can just double click to reboot the box.

The password is in clear text but it’s not an issue in our environment.

Other resources
https://en.wikipedia.org/wiki/Google_Chrome_version_history

https://peter.sh/experiments/chromium-command-line-switches/

——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————-