Windows - Are You Sure About This?
Installation
USB Flash Drive For Normal People
You’re a hard core Linux person, but now you have to interact with a commercial photo printing machine. Or you want to play MP3s in your 2013 car which has a USB port. What to do?
sudo fdisk /dev/sdh
Delete all partitions, add one, set its type to b for "W95 FAT32" so it looks something like this.
:->$ sudo fdisk -l /dev/sdh
Disk /dev/sdh: 967.5 MiB, 1014497280 bytes, 1981440 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x66f9889b
Device Boot Start End Sectors Size Id Type
/dev/sdh1 2048 1981439 1979392 966.5M b W95 FAT32
I’m not sure how this irritatingly ubiquitous file system handles significantly larger volumes. Once you have the partition, here is a command that will format it such that it can be read by muggles' computers. (Turn on that physical RO switch obviously before doing that!)
_ mkfs.vfat -n "W95FAT32VFAT" /dev/sdh1
Yes. This worked in my car.
Windows Installed On A USB Flash Drive?
Is it possible to install Windows 10 to a USB flash drive? Seems like it might be but it’s definitely not easy if you have to use an install image compatible with some kind of license server.
Maybe this helps?
Physical DVDs
Note that CDs are too small. Often 4GB USB flash drives are less than
1% too small. Burn the image to the DVD with wodim
or cdrecord
or
some such thing.
Check the results…
# Put the Disk in and give it some time to settle...
F=/path/SW_DVD9_Win_Pro_8.1_64BIT_English_-2_MLF_X19-49879.ISO
md5sum $F
dd if=/dev/sr0 bs=2048 count=$(( $( stat -c '%s' $F ) / 2048 )) | md5sum
This must be done to not hash the unwritten zeros at the end of the disk.
That tip comes from here which also reminds us that…
"Windows does not come with md5sum. You must download one from another location, preferably one that you trust." Facepalm.
Is this USB download thing from Microsoft useful?
Installing Windows 10 From USB Installation Media
Obviously since neolithic times, people have not used plastic discs to install anything. Although Microsoft stubbornly held on to the past, now its not just weird people who have no CDROM drive on hand.
I tried a lot of things like downloading the Windows 10 ISO from
Microsoft and then using dd
to put that on a flash drive. I don’t
even know what that ISO is supposed to do but that strategy does not
work.
Eventually I gave up trying to get a Microsoft approved installation USB prepared from Linux (come on, you’d think they’d at least help with that Linux task!). I then tried using Windows 7 but that seemed like a waste of time.
After hunting down a legitimate piece of the Windows 10 borg, I downloaded the Media Creation Tool 1809.
Running that, it took a long time (and probably a lot of bandwidth) until it died with some vague error (specifically "0x80042405"). Researching that, I found this thread which proposes the most idiotic ridiculous suggestion. And, of course, it worked. So here’s the right way to execute this process.
-
Format the USB drive to FAT32 (not NTFS — tried that test and it failed)
-
Now copy the Media Creation Tool to the target drive itself
-
Right click the new copy on the USB drive and run as administrator
-
Accept license
-
Create installation media
-
Language/architecture
-
USB Flash drive
-
Select the correct one
Looks like I’m no longer the only person in the world who would ever need to create a Windows install disk without having Windows. Check out WoeUSB.
git clone https://github.com/slacka/WoeUSB
cd WoeUSB/
apt install libwxgtk3.0-dev gettext
autoreconf --force --install
./configure
make
Then get the Windows image. I had their download website say this idiotic thing: "This may take several minutes. Do not refresh the page or select back, doing so will cancel the request." After running all night, it didn’t progress. The answer was to not choose the latest version on offer but rather the older image.
Then try to run it with something like this.
sudo ./woeusb --target-filesystem NTFS --device /tmp/Win10_1809Oct_v2_English_x64.iso /dev/sdb
Oh gosh. That dies with a grub error. Wonderful. Hang on a moment! It works anyway. Ok, so if this process mostly seems to write a big something to your USB drive but you get an error code on exit and some fuss about Grub, give it a try anyway.
Windows Pro Tip: When the install prompts you, do not give your wifi credentials. But telling the install process that you will have a network "later" you can get on with things but if you reveal you have a network, the "Skip" option disappears when it pushes you hard to cough up your phone number and email addresses. Add wifi once everything is up if you need it.
Remove Login Password
On a proper operating system I’m all for logging in properly. But on Windows? No. It’s already compromised so best to minimize annoyances. And that login page which makes you "swipe" or do some other non-obvious thing is annoying.
Simply go to the start menu and type "netplwiz". When that finally comes up, click "Users must enter a user name and password to use this computer." Apply, OK, or something like that. Done.
Breaking into a Windows System - chntpw
Use chntpw which is already installed and ready for action on sysresccd.org.
You have to first mount the Windows main partition.
ntfs-3g /dev/sda2 /mnt/windows
Change directory to the place where the security guts are kept.
cd /mnt/windows/Windows/System32/config/
Have a look at the accounts database if you like.
chntpw -l SAM
I then just use the interactive mode to clear and unlock what needs to be fixed. The actual command to use will be something like this.
chntpw -u Administrator -e SAM
Check the chntpw -h
figure out accurate syntax.
How To Degunk A New Windows System
Did you know that when you buy a brand new Windows computer it is quite possibly infected with very bad stuff? I have actually encountered this kind of thing personally. Blows my mind. Apparently Windows users have an infinite capacity for abuse.
Fight creepy bloatware with creepy bloatware, of course! This one has been deemed kosher by someone I trust.
Note
|
This doesn’t get rid of the Vosteran or Superfish problems. But, hey, it’s a nice magic ritual. |
Is it safe to download some utility? Probably not. Regarding "free" utilities that need to be downloaded to make Windows actually sane: "Because when the product is free the real product is YOU."
Here’s how to ask Google who they think might be icky:
Correcting The Error Of The Caps Lock Key
It is possible in Windows. See my caps lock notes.
WTF (Exactly) Is This Terrible OS
Don’t use PowerShell (bloody useless). Use cmd
and try:
ver
systeminfo
wmic os get Caption,CSDVersion /value
Note that Windows 7 comes up as 6.1.
WTF Is This Machine Doing
Of course Windows has a process viewer. Of course it’s not installed by default. DIY here:
You can try looking for "Task Manager"; maybe by pressing Ctrl-Shift-Esc. This Task Manager apparently has a way to disable startup programs (i.e. that you probably didn’t really want to start).
You can try tasklist
from the cmd
shell. Maybe
even tasklist | find "myprocess" /i
.
Uptime
To simulate the Linux uptime
command, try.
net stats <hostname>
If you don’t know the "hostname" the net stats
command will give you
a hint.
Don’t Hide Things
It’s very frustrating when you have a ‘myfile.doc` and a myfile
but
you can’t tell them apart because Windows’ interface wants to lie to
you every step of the way.
To show complete file names including extensions do this.
-
Start Windows Explorer, you can do this by opening up any folder.
-
Click Organize.
-
Click Folder and search options.
-
Click the View tab.
-
Scroll down to "Hide extensions for known file types".
-
Un-check.
-
Click OK
WTF Is The Mac Address
Use cmd
and:
getmac
License
Wonder what’s up with the license? Try this.
-
From the Start screen, type CMD and press the Enter key
-
At the command prompt, type slmgr.vbs /dli and press the Enter key
-
For a more detailed report run slmgr.vbs /dlv
Works on Windows 8 anyway.
Telnet
Sometimes you want to use echo > /dev/tcp/host/port
but you’re
fighting with Windows. Netcat? Nmap? Creepy shareware? Turns out that
Windows does come with Telnet but, astonishingly, it is hidden and
deactivated.
-
Control panel
-
Programs
-
Turn Windows features on or off
-
Telnet Client
-
OK
Or try this untested method on the command line.
pkgmgr /iu:"TelnetClient"
Then restart the terminal.
This should return some HTML from a working web server.
telnet www.example.com 80
GET /
Using A Proxy To Keep This Insecure OS Off Of The Real Internet
Systemwide on Vista/Server 2008/Windows 7
From a privileged cmd shell.
netsh winhttp set proxy proxy-server="webproxy.ucsd.edu:3128" bypass-list="*.ucsd.edu"
If that doesn’t work, try the following method.
Windows 7ish - The Crazy IE Way
It’s crazy but it does work. I am told that the GUI proxy settings under Windows change the settings for only the current logged-in user.
-
Run IE.
-
Go to
Tools
menu. -
Internet options
. -
Connections
. -
LAN settings
. -
Check "Use a proxy server for your LAN…"
-
Use:
webproxy.ucsd.edu
and port3128
. -
Check with an outside web page.
-
Open a
cmd
shell andNetsh winhttp import proxy source=ie
-
Check with
Netsh winhttp show proxy
-
Go to Control Panel "Windows Update" and check for updates.
Systemwide XP/2003
proxycfg -p "webproxy.ucsd.edu:3128" "*.ucsd.edu"
Troubleshooting
Keyboard and Mouse Don’t Work On Install
It seems that the Windows 7 (at least) installer can’t recognize USB3 ports. If your only keyboard option is USB and there are no USB2 ports you’re out of luck.
-
Use a USB2 port.
-
Use a PS2 keyboard (the mouse is not essential)
-
Disable USB3 mode in BIOS (sometimes possible)
-
Install elsewhere and move hard drive - ugly for fragile Windows
Here’s another possible solution.
Won’t Remember Credentials For Mapped Drive
You’re tyring to mount a Samba share and it finally works just fine. When you defined the network mapping and entered your credentials, you definitely clicked the box that said "remember credentials". Yet when you reboot, it needs the credentials again. Super annoying!
Here’s a web page with some answers. I haven’t tested these but it looks like the right place to start.
Maybe a command line approach? Try net use /h
for help.
net use X: \\Hostname\Share /savecred /p:yes
I think the /p
is for persistent.
Office Site License Fiascos
Problem: You install a copy of Office provided by your institution which has a site license. Then the user reports this:
Apparently I have just one more day of use on my Office product you downloaded about a month ago on my laptop - it is requesting a 25 character product key
Here is a troubleshooting guide sent to me by the people who set up the site licenses.
The software will connect to the license server via DNS, so as long as the
connection is via UCSD network, it should contact the KMS server. You can
follow these steps below on trying to get that host activated. We have 2 KMS
servers on campus so you can use either option to connect to.
If you are using Office 2013 instead, please replace with "Office15".
Office16:
1: Type CD \Program Files\Microsoft Office\Office16 and Press Enter. This
+assumes you installed Office in the default location.
Note: If you installed the 32-bit version of Office on a 64-bit system, use
this path instead:
CD \Program Files (x86)\Microsoft Office\Office16
2. Type the following command:
cscript ospp.vbs /sethst:acms-kms2-srv
(or acms-kms1-srv) and press Enter.
3. Type the following command:
cscript ospp.vbs /act
and press Enter.
4. You should receive <Product activation successful> messages at this point.
5. Close the command prompt window
If that still does not work, I can give you a key to type in that
would avoid having to use the KMS server.
Also based on this, the following Microsoft resource looks potentially helpful: https://technet.microsoft.com/en-us/library/ee624350.aspx
2014-06-01 - Amazon
-
Windows 7 Home Premium SP1 64bit, System Builder OEM DVD 1 Pack
List Price: $119.99
Price: $91.70
-
Windows 7 Professional SP1 64bit System Builder DVD 1 Pack
List Price: $149.99
Price: $122.95
-
Windows 8.1 System Builder OEM DVD 64-Bit
List Price: $119.99
Price: $94.57
-
Windows 8.1 Pro System Builder OEM DVD 64-Bit
List Price: $199.99
Price: $132.61
-
Windows 8.1 System Builder OEM DVD 32-Bit
List Price: $119.99
Prince: $99.99
-
Windows 8.1 Pro System Builder OEM DVD 32-Bit
List Price: $199.99
Prince: $139.99
Helpful?
Amelioration
WSL - Windows Subsystem For Linux
These days Microsoft has pretty well cured the problem of Windows being inexcusably beyond terrible by including and integrating some obvious and ancient free software that Macs have been using since 2001 and competent computer professionals even longer. Windows 10 runs Bash using their Linux API which I blog about here. Tested! Works!
Decent notes on installing Windows Subsystem For Linux including a Debian distribution. Another howto link.
And to navigate out of their protective sandbox, you’ll want a path
like this (for C:\
): /mnt/c
Other Old Desperate Attempts At Sanity
-
PuTTY - The classic SSH client for Windows.
-
Cygwin - Still the classic repair.
-
Babun - Cygwin preconfigured for ease of use.
-
MobaXterm - A Windows SSH client combined with an X server. This looks like a more ambitious PuTTY.
-
Gow - GNU On Windows. Lighter than Cygwin.
-
MinGW - Minimalistic GNU for Windows.
-
Foreign Linux - Run Linux binaries in Windows.
-
GnuWin - Provides ported Unix tools to Windows. Maybe obsolete.