How do you configure a Windows machine for a Linux user? [closed]

Solution 1:

I'm a linux sysadmin, but I personally use Windows. This leads to some annoyances when switching back and forth, since I'm used to both platforms. Here's some things I do:

  • Use batch scripts to provide ls, clear, etc. on Windows. Alternatively, you could alias dir and cls, for example, in Bash, do it whichever way you want.
  • XMouse for Windows will give you the X-style mouse action you're used to in the Windows environment.
  • Xming is a native Windows x-server that will let you SSH forward applications from Linux boxen.
  • Windows Powershell isn't a duplication of Bash, but a whole new shell designed by Microsoft. Deep down inside it actually accepts and returns .NET objects, rather than text, which is cool. Powershell is installed by default in Windows 7, and Microsoft has a good quickstart guide. PowerShell does a lot to alleviate the common Linux user complaint that Windows has a useless command interpreter.
  • Remember that Windows is fine with forward slash (/) in file paths, even though it uses the backslash (\) natively. So your Linux user only needs to get used to starting paths with a drive letter, they don't need to worry too much about slash direction.
  • Also remember that Windows is, as a rule, NOT case-sensitive. This might take a bit of getting used to, because File and file are the same thing here.
  • Read up on NTFS access control lists, they're a lot more powerful (and thus complicated) than Unix permissions. Here's a quick guide.
  • Download the whole PuTTY suite and put it somewher in your path (remember that you can change the path by right clicking Computer in the start menu, clicking Advanced in the left bar, clicking Environment Variables, and then choosing PATH from either list - there's both a global path and a user-specific path, they're concatenated together). This set of tools will give you pscp and psftp, Windows equivalents of the Unix commands without the P. PuTTY itself is a fantastic SSH client, and PuTTYGen will make your RSA keys for working with Linux boxes.
  • Download and install GnuWin32, which will give you native Windows versions of many of the familiar Unix commands (tar, grep, sed, etc).

Solution 2:

In a VM, of course.

Yes, I know painfully well that's not always possible. So I'll answer based on my personal experience (long-time unix user, uses the command line a lot, recently forced to use Windows XP by company policy). In particular, I needed a truckload of third-party add-ons to be productive. All software mentioned in this answer is free as in gratis.

GUI features

  • From the GUI perspective, the single most important thing was multiple desktops. This was really a life-changer: it's the only way I've found to decently organize windows under Windows. I settled on VirtuaWin, which is reasonably functional. I briefly tried the Microsoft offering, MSVDM, but the words to describe it would get this answer censored. (Maybe there's something better for Vista and up.) Other alternatives include Vern and Virtual Dimension, both a little buggier and slower than VirtuaWin.
  • KatMouse makes the mouse wheel scroll wherever the cursor is, rather than whatever has the keyboard focus. It doesn't fully work in Office, but it does make the wheel usable. To be able to use the mouse button for its intended purpose (i.e. pasting), turn off the “push button” feature in the KatMouse properties (“Wheel Button” tab).
  • Some applications can be configured to paste on a middle click. For others see "Select to Copy and Middle Click to Paste" in Windows.
  • WinCompose emulates a Compose key, if you need to type characters that aren't on your keyboard.
  • HandyFind brings incremental search to many applications, including MS Office.
  • You'll probably want to tune many settings in various corners of the Control Panel, but which ones depends strongly on personal preferences.
  • To automate simple GUI tasks, use AutoHotkey. Unfortunately, the macro language makes Visual Basic looks good.

Applications

  • Of course, you'll want Firefox and Chrome.
  • Windows inexplicably doesn't come with a PDF reader. I haven't found one I really liked, but settled on Foxit Reader, which is ok. Be sure to deselect the bundled browser malware (toolbar, etc.) on installation. Sumatra PDF is an alternative.
  • In MS Office 2007, the Search Commands plugin is helpful, when you have an idea of how a command might be called but no clue what the icon is supposed to look like.
  • For Emacs users: get EmacsW32 binaries. EmacsW32 comes with a small set of auxiliary utilities (especially diff and grep) from GNUWin32 (see below), but Cygwin is a better complement, e.g. it includes a shell that understands M-x grep foo *.[hc] and version control software.
    • If you want Emacs 24 (which has improved Windows support), since EmacsW32 hasn't been updated since 2010-10-19, you may prefer to get the barebones official weekly builds or the emacs-for-windows build.
    • For Tramp, I use the plinkx method, using the plink command from PuTTY.

Command line

  • Cygwin is the only remotely sizable suite of ports of unix tools, both command-line and GUI. I actually don't use the X server, but use shells and terminal applications extensively. It's slow and sometimes cranky, but nothing else delivers.
    • apt-cyg is a command-line package manager for Cygwin. It's easier to use than the GUI of Cygwin's setup.exe. You must first install the subversion package to download apt-cyg, and bzip2, gawk, tar and wget to use it. Run apt-cyg -u COMMAND to avoid re-downloading the package index.
  • There are other suites of unix shell tools such as GNUWin32 (installer), MSys, UWin. They're mainly intended to run unix shell scripts, get Cygwin for interactive use.
  • If you aren't going to use the X server, you need a decent terminal emulator (Windows doesn't come with one). The main contenders are Cygwin's native RXVT, MinTTY and PuTTYcyg. I have a preference for MinTTY (and found the author to be very responsive to issues), but none of the three are bad. RXVT doesn't support Unicode.
  • The Cygwin terminals can't run most Windows console applications. Use Console2 for that.
  • For those times when you have to use CMD (the default command-line shell under Windows), make sure to turn on completion with these registry settings (Tab completes file names and Ctrl+D completes directory names, hey, it's a start):

    [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    "CompletionChar"=dword:00000009
    "PathCompletionChar"=dword:00000004
    
  • If you need to log in to other machines with SSH, either get PuTTY, or Cygwin's SSH.
    • PuTTY comes with its own ssh-agent-like program, Pageant; Charade lets Cygwin's ssh access keys stored in Pageant.
    • To run X applications in a separate window, you can use Xming.
  • To unmount a removable drive from the command line, you can use devcon: devcon listclass DiskDrive then devcon remove @usbstor\….

Power users and developers

  • Process Explorer is a decent GUI process monitor (top and a little more).
  • Other utilities in the Sysinternals suite can be useful, particularly if you don't use Cygwin all the time. Handle is an lsof equivalent. Junction gives access to a form of symbolic links (they exist under the hood, and Windows applications see transparently, but as of XP, you need a third-party utility to create them).
  • The equivalent of .profile is a combination of the Control Panel “System” dialog, “Advanced” tab, “Environment variables” dialog; and various ways of launching programs at boot or login time.
  • StraceNT is a Windows equivalent of truss/strace/….
  • Windows has a nasty habit of using mandatory locks. Unlocker helps you fight back. Be sure to deselect the bundled browser malware (toolbar, etc.) on installation.
  • The closest I could find to ldd is Dependency Walker (doesn't nearly have the straight-to-the-point convenience of ldd, but shows a lot of information).
  • For XP users who need to deal with permissions: for much of what exists under the hood, there's no official utility before Vista. So get SetACL.