Installing Windows (2022)
I work at Mozilla. We get a laptop refresh periodically. I got a new laptop that I was going to replace my older laptop with. I'm a software engineer and I work on services that are built using Docker and tooling that runs on Linux.
This post covers my attempt at setting up a Windows laptop for software development for the projects I work on after having spent the last 20 years predominantly using Linux and Linux-like environments.
Spoiler: This is a failed attempt and I gave up and stuck with Linux.
Wait, why write this?
Mozilla doesn't have a standard for how to set up a machine running Windows 11. I figured I'd document it in my blog in case I make another attempt another day.
Basic setup based on "How to configure your new Windows Computer" which covers Windows 10 and is pretty different.
Turn on machine:
Select country, locale, and keyboard layout.
Set up network.
Setup will ask you to choose a device name. Use ldapname hyphen asset tag. For example, mine would be something like "wkahngreene-11111".
In my case, that's too long and I didn't want to drop the asset tag number or shorten my name because that gets confusing for me. So isntead, I used my nickname: "willkg-11111".
Set up an account.
Microsoft really wants you to set up an online Microsoft Account. But we don't want to do that. So we follow the ridiculous steps in this article to set up a local account:
Use an account username that has no spaces so that your system works correctly with platforms like Treeherder. Make a note of username and password and put them into your password manager later.
Choose the recovery security questions you would like and provide answers for them. Make a note of these also so that you can upload them to your password manager later for safekeeping.
Next is privacy settings. Set everything to "not share".
Once you're logged in, go to Windows Updates and update everything.
Note: This may involve multiple reboots and take a couple of hours.
Mozilla's instructions for Windows 10 suggest to remove the manufacturer system software because it can pose security risks.
Go to Windows Settings -> Apps
Find an item with "Dell" or "Lenovo" and then something like "System updater". For example, "Dell Command | System Updater".
Next to update security settings. This is based on "Windows 10 Client Security Checkup".
Go to Windows Update -> Advanced Options
Turn on "Receive updates for other Microsoft products"
Turn on "Notify me when a restart is required to finish updating"
Go to Privacy and Security -> Windows Security -> Virus and threat protection
Make sure "Real-time protection", "Cloud-delivered protection", and "Automatic sample submission" are all on
Go to Personalization -> Power & battery
In "Screen and sleep", make sure none of the situations are > 10 minutes
In Firewall & network protection
Make sure the firewall is on for Domain network, Private network, and Public network.
Install a printer if you can
In Control Panel -> System and Security -> Bitlocker drive encryption
Click on "Turn on Bitlocker" and print out the backup key
Make a installation media drive
Now to install the things I need to do my job.
Go to Taskbar settings
Ditch widgets -- they need a Microsoft account and they're terrible
Unpin Microsoft programs from taskbar
Open Edge and use it to download and install Firefox
Install "App Installer" (aka winget) from the Microsoft Store
Open a Terminal with Powershell and install the following things:
winget install Mozilla.Firefox
Install Microsoft PowerToys:
winget install Microsoft.PowerToys
Then remap capslock to left ctrl.
Install Windows Terminal (preview):
winget install Microsoft.WindowsTerminal.Preview
Then fix split-down to ctrl-shift-o and split-right to ctrl-shift-e like gnome-terminator.
winget install SlackTechnologies.Slack
Use SSO to log in.
winget install Element.Element
Home server is "chat.mozilla.org"
winget install Zoom.Zoom
Use SSO to log in.
winget install evernote.evernote
winget install AgileBits.1Password
winget install Docker.DockerDesktop
Reboot and create login.
Open up a terminal in Ubuntu and start setting up my dev environment.
At this point, when copying files from the old laptop to the new lpatop, I discovered the problem where wsl is a complete featherbrained nitwit and can't keep track of time when the computer is sleeping.
wsl issue 8204
If I have a wsl terminal open and I do the following:
dateand hit ENTER
put the computer to sleep
wait 5 minutes
wait the computer up
dateand hit ENTER
The second date suggests no time has passed at all. I can reliably reproduce this .
This is covered in issue 8204 which was created in March 2022 and is still an issue that appears to have no one looking into it. There are a couple of other issues in the issue tracker spanning several years.
There are several workarounds mentioned. One of them is to type:
sudo hwclock -s
whenever you wake up the computer. That doesn't work for me--it never fixed the date correctly. Usually it got close. I had a couple of occasions where the time ended up in the future which makes some tools really grumpy.
Another workaround is to set up systemd and timesyncd. You can only do it in one wsl thing, though--don't do it in all of them. I thought about trying this out, but then didn't.
Instead, I decided this is a complete non-starter for me. The tools I use need to know wtf time it is. Updating the time via a scheduled task or manually isn't good enough.
Given that I wanted to use wsl to do all my work and wsl wasn't working, I figured I had a couple of options:
I could switch to doing all my work in a VM. I've done this in the past and I could do this again, but I really didn't want to. It's usually frustrating. Though this new machine has 32gb of RAM so maybe it'd be less of a pain in the ass.
I could give up and continue using Linux. This wsl time issue is so wild that it's hard not to see it as a sign that I shouldn't have even entertained the notion of switching in the first place.
While I have things I don't like about Linux that I've largely grown numb to and I'd have to continue using Zoom  on a separate machine, I decided this was the best option for me. I just want to get my work done.
I lost a few days of work figuring this out and I stuck with Linux.