Windows for Linux Users

David N. Welton
davidw@dedasys.com
2007-8-1

This article was originally a wiki, at win4.leenooks.com. After many months of very few updates, and a lot of spam, I decided to commit the accumulated wisdom to an article. If you have any corrections or additions, please email them to me.

A big thanks to everyone who contributed to the wiki over the past couple of years!

Introduction

I have been fortunate to have used Linux exclusively for the past 10 years or so, very rarely utilizing Microsoft Windows. Several years ago, I acquired several clients that absolutely needed work done on the windows platform, so I had to bite the bullet and dive in. It has mostly been as unpleasant as I imagined, and I've had to struggle a lot, starting from the installation onwards.

I created the original wiki in order to share some of the things I learned. It is meant as a guide to windows for Linux users who are struggling like I was to be productive with an unfamiliar system. Given the relative popularity of windows and Linux, I don't expect that there are that many of us, but perhaps that's changing these days.

Installation

I found the Windows XP installation process to be slower and far less flexible than a recent Ubuntu install. Frankly, the Ubuntu text based installer is visually better too, in that it gives me an idea of what's going on. There are several ways of approaching the installation problem, depending on what you need to accomplish:

Windows on a second hard drive

This is what I did, and it was difficult. Most advice on the web seems to indicate that you are better off installing windows first, on the primary/master hard drive, and then installing Linux elsewhere, because the windows install is not terribly intelligent and doesn't give you the flexibility to move things around as you see fit.

Given that I already had Linux installed, and wanted to put Windows on the slave HD, I managed to get things working by

  1. Unplugging the Linux HD.
  2. Installing Windows on the secondary HD.
  3. Adding the following magic to grub:
title           Windows XP
map             (hd0) (hd1)
map             (hd1) (hd0)
root            (hd1,0)
makeactive
chainloader     +1

Which makes things work ok. Under Linux, I can see the windows partion as /dev/hdb1/

VMware

This is probably the best approach, because you can very quickly swap in and out of Windows. Drawbacks: you need a lot of memory to make it work, and VMware isn't cheap. Since I didn't opt for this route, I don't have any instructions, but I'm sure that plenty of people have accomplished this without problems.

Qemu

This is an alternative to VMWare and is getting to be quite advanced if you add the 'accelerator' download to it it's very fast.

Linux On Windows

This might be a suitable alternative in some cases - if you're stuck with windows and want to use Linux from time to time, for instance. I don't have much information beyond the idea of using VMWare on Windows to host Linux.

Windows on a separate machine

Dan O'Huiginn writes to suggest running Windows on a separate machine and connecting to it via rdesktop. That way you don't have to worry about the memory and CPU requirements for having two OS's running at the same time, but can still use both at once. The downside is that latency can be a bit higher, meaning it's not a good way to watch movies, for instance. If you don't have a spare computer, you could even use a service like Flexiscale on a pay-as-you-go basis, if you don't need Windows that often.

Tools

If you're a programmer like I am, you spend all your time working through your tools - editors, compilers, scripts, and things of that ilk. What's out there on windows?

cygwin

The first thing you need to get, of course, is cygwin This includes tons of useful ports of Unix software to windows including bash (no cmd.exe for me, thanks!), ssh, grep, ps, and all your favorites.

GnuWin32

GnuWin32 provides Win32 (MS Windows 95 / 98 / ME / NT / 2000 / XP) ports of tools with a GNU or similar open source license. Useful if you use Windows command prompt and want a minimal and non-invasive way to have find, grep, sed, tail available or just to stop typing "ls" and get "command not found" error messages.

UnxUtils

UnxUtils is another port of common tools. These are all native binaries, with no dependence upon any of the cygwin DLL's, so they are a nice alternative. The collection also includes some additional utilities for clipboard access.

xemacs

Ok, ok, so I'm an emacs junkie! I normally use GNU Emacs, but Xemacs seems much faster to get working on windows in that it has a windows installer. Compare the instructions here for installing GNU Emacs, with the simple 'Install Now!' at http://www.xemacs.org/Download/index.html.

vi

Those of you who prefer hitting the esc key all the time instead of ctrl-alt-meta-shit can download Cream and install. This will give you Vim plus a bunch of plugins. Since Cream uses Windows-esque keybindings by default, you can share it with cow-orkers who can't use a real editor, while you can either change the default keybindings (it's even a menu option) back to vi, or simply run the included Vim without the Cream plugins. Best of both worlds.

Another alternative is to install just VIM for Windows, which is just your regular VIM (with no Windows flavor) at it's latest version (Windows Cream usually lags a bit behind the latest VIM version).

Eclipse

Eclipse is an IDE platform. Since it also runs on Linux you may have heard of it. It has good native support for Java, C and C++ development and CVS, and with free plugins you also get Python, PHP, and Subversion, so in reality it does a lot more than Java these days. Of course, it also takes something like a gig of memory to get started, so be forewarned...

Perl Shell

The Perl Shell (psh) combines aspects of bash and other shells with the power of Perl scripting. It aspires to be your primary login shell. This is a production quality shell, and there is a native windows port.

Subversion

Every developer needs revision control. Subversion runs natively and you can get plugins for Windows Explorer, Eclipse, and Visual Studio.

SSH client

PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along with an xterm terminal emulator. It provides also command line file transfer clients and ssh-agent.

Network Analyzer

If you're writing network applications, or need to support them, a network analysis tool can be very helpful in quickly getting to the root of problems. Ethereal is such a tool and is licensed under the GPL. It can read capture files from many other analysis tools, making it a one-stop-tool for commercial network helpdesks. Also of note is the 'Follow TCP Stream' option to reconstruct a session starting with only a single packet from the stream. Ethereal also (optionally) performs colour highlighting of packets. By default, it will do this for TCP packets based on state. Ethereal does seem to have more than its fair share of security vulnerabilities, so take care to keep it up-to-date.

Environment

As someone who has very specific ideas about what my window manager and environment should be like under Linux, Windows is a painful experience. This page discusses tools and tips to make life a little bit easier and more productive.

Focus follows mouse and X11 Cut'n'Paste

I am used to having the focus follow the mouse, instead of clicking hither and yon to activate different windows. I also vastly prefer the X11 style mouse left button/ middle button combination for copy and paste operations. I found this program to be quite helpful: "True X-Mouse Gizmo": http://fy.chalmers.se/~appro/nt/TXMouse/

Virtual Desktop Manager

I like having multiple desktops. Microsoft themselves provide a virtual desktop manager here: http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx although I would like it even more if I could use alt + arrow keys to navigate between the different desktops, like I do in Linux. An alternative to Microsoft's Virtual Desktop Manager is VirtuaWin. VirtuaWin is licensed under the GPL and is modular. Recommended modules include 'VWAssigner', 'Win32WM' (which allows X-style ALT+mouse moving/resizing of windows) and WinList.

X

In cygwin, if you've installed the X portion of the system, you can simply run startx and get X programs like xterm (which is much nicer than the clunky windows terminal screens).

Tab completion at command prompt

Tab completion is enabled by default in Windows XP but if you are running an older release you can enable it as explained in this article.

Emacs Keys for input fields,... in all windows programs

XKeymacs allows you to enable Emacs Keys in all Windows Applications. It is configurable on a per-application per-key basis so if one key makes problems in that application you can disable it and if the whole program doesn't work right with a specific app you can still use it for all the others you are running.

Misc. registry patches

Shell Replacements

If you find explorer.exe to be a UI disaster, or just plain inconvenient, you may want to try a replacement shell such as LiteStep, DarkStep, or some other. This can be a good way to obviate the brain-dead window manager/desktop environment that is provided with windows. A good place to start is Shellfront, or DMOZ. Be forewarned that some shell replacements (just like some X11 WMs) are not very mature. Litestep is mature, and has an installer.

In addition windowblindshttp://www.windowblinds.net/ (although not linux like at all) can do similar things with the windows shell to make it much more useful.

Programming

In which we discuss some of the first things a Linux programmer might run into when attempting to code on Windows, as well as cross-platform tools and techniques that will let you write code that basically works on more than one system, modulo the bit of tweaking that's always necessary.

Most of the major scripting languages (Ruby, Tcl, Python, Perl, and so on) work pretty well on Windows, so using one of those is often a good idea.

GUI Toolkits

One area that has always been problematic is the GUI Toolkit. Make something very cross-platform, and users are still likely to make applications that don't look quite right anywhere. On the other hand, that's probably better than being tied to one platform with no possibility of porting.

Security

We've all heard the horror stories about Windows security. Here are some tips for improving it.

First off, we start with a guide dedicated to windows security: Secure your Windows XP/2000 system.

And continue with some other suggestions, contributed by the wiki's users:

One annoying problem is the huge number of malware (dialers, trojan horses, bots ...) easily installed in virtue of os bugs. I found a little utility Autoruns (freeware but not free software) very useful to discover register keys added by malware, making it easier to manually remove them.

Windows Registry

The following locations are favorites of malware and viruses - after adding themselves here, they are automatically run.

The Browser Helper Objects are add-ons to Internet Explorer. Some are legitimate, like Flash, Spybot, Java, or Acrobat. Some are completely bogus malware. In that case, one finds funny hexademical folders in the registry 'directory'. Each of these pertains to something called a GUID, a Globally Unique Identifier. In this case, the GUID refers to a DLL add-on, and DLLs contain class objects, so that's why we call this particular kind of GUID a CLASSID. To find out which CLASSID goes to what add-on in IE, you have to look in: HKCR/CLSID

Other

Other helpful programs that don't really fit in any category:

Explore2fs

Explore2fs is a file-manager that lets you browse ext2 and ext3 filesystems from within Windows.

Copyright © 2000-2018 David N. Welton