Microsoft's Services For Unix
Gosh, you'd never expect me to say something pleasant about a Windows machine, would you? Well, actually that's not entirely true: I've been known to grudgingly admit that while it isn't Unix, Windows XP Professional really isn't awful. In fact, if you can live without Unixy stuff at your beck and call, Windows XP is pretty good - there are even things I actually LIKE about it.
But there is that lack of Unix shells and commands, and for all its other charms, that alone makes XP (or any Windows operating system) unpalatable for me. Well, for $99.00 or less, Microsoft has a solution: Services For Unix, and while I still plan on keeping my iBook, if i HAD to use Windows (right after they finish killing off everything else, I guess), having this would surely make me a lot happier about it.
So here's a screenshot (XP running under Virtual PC, Korn Shell under Windows Services For Unix) showing a Korn shell open.
For me, that's 90% of the battle right there. Yes, I need vi and sort and a few other things (which are all there), but most of what I hate about Windows is the lack of a command line shell. Dos "command" doesn't even begin to cut it. In recent years I have grown to prefer bash, but there's nothing wrong with ksh: I can adjust to the minor differences. There's also an (ugh!) csh included for those poor folks who still think that abomination should even be allowed disk space on their machines.
This isn't just a set of Unixy tools for Windows; it's a real POSIX environment.
Did you notice that DISPLAY=aplxp:0:0 ?
If you looked at /usr/X11R5/bin, you'd find X programs, so you might think this is all ready to go. Well, not quite. You need X11 running, and that isn't included. Easy enough to get though: plenty available on the web.
I was happily surprised to find that both hard and symbolic links are supported. Hard links do require a newer Windows file system; you can't do a hard link on FAT. But symbolic links work fine.
Filesystem semantics also may affect permissions. For example, a "chmod 755" on a FAT filesystem results in 777. You get warned when that sort of thing happens.
Speaking of permissions, setuid is supported too. It's not exactly like Unix, but it makes sense in Windows: there's no "root" user, but any Administrative user effectively has the same powers. Like any extended permission, you need a filesystem that can store the bits, and FAT of course cannot.
su and passwords
The "su" command does work regardless of filesystem, though you need to be using passwords for the users. As there is no root user, you wouldn't expect a simple "su" with no name to work, but in fact it switches you to the Administrator account. As that may have been renamed during XP installation, that can be a little confusing. For example, when I installed XP, the Administrator account became "tony". I also added three other users: one with admin privileges and a password, one limited account with a password, and one limited account without a password.
Logged in as any user, I can run ksh and then "su" to any other user. I'll be prompted for their password as you would expect. If I just use "su", I am prompted for a password and I can either use "tony"'s current password (because "tony" was the Administrator account when XP was installed) or the password that "tony" originally had: apparently that sticks with "Administrator". This behavior changes after the "tony" password is changed again: XP passwords are a little odd.
Although "tony" is an Administrator, "su tony" isn't quite the same as just "su". After "su", I can su to any other user without being prompted for their password, but as "su tony", I can't. Obviously just "su" is closer to a "root" concept.
Services for Unix includes both an NFS client and server. There's a PCNFS server too, though I cannot imagine why. I didn't experiment with any of the NFS tools; perhaps there is some good reason for PCNFS. There's also Gateway for NFS, which lets this machine become a bridge for normal SMB Windows clients to access NFS shares on some other computer. That could be helpful.
Other drives are found under /dev/fs (/dev/fs/A is your floppy, D might be your CD, etc). You of course can make symbolic links to have these any place that's convenient for you. I managed to kill Ksh dead by cd'ing to my Virtual PC Z drive, which is really my Mac Desktop. I don't think it was entirely reasonable of me to think that would work, so I wasn't upset that it didn't.
NIS and Active Directory
There's another area I didn't bother with. I don't have Windows Domains of any kind and tend to avoid them - not that domains are a Bad Thing, just that they really aren't needed in the small business area I play in. But the docs claim that password synchronization across Windows/Unix machines is possible with this.
A telnet client (apparently no different than that built into XP) and a telnet server are include. No ssh though, which is too bad. Of course it isn't hard to find ssh clients for Windows, and it might even be possible to compile an sshd here.
This includes the GNU compilers etc. but these are not installed by default. I went back and installed these, but ran into problems: I'd type cc or make, and an error message would shortly come up telling me that I needed a compiler option set because it couldn't find CL.EXE. That's the Visual C++ compiler, which I don't have, so I couldn't do much here.
A product evangelist from Microsoft tells me:Interesting read. You can compile lots of code with SFU using gcc (not cc).
I'm sure there will be problems with porting programs. Windows Services For Unix is a POSIX environment, not truly Unix. Some things, like path names, could be resolved with symbolic links. If you are using NTFS, the Interix environment takes care of case sensitivity, giving you Unix-like upper and lower case capability. But there may be differences in allowed file name characters that could trip you up, and little POSIX gotchas will surely prevent or at least make some ports very difficult.
But that's hardly unusual, is it? I'm not very interested in porting stuff anyway: if you need a full Unix environment, why would you run Windows? No, this is for interoperability and perhaps for people like me if we had to use Windows for some other reason. As such, it seems pretty good to me. Did I actually say that? Ayup: XP or Windows 2000 with the addition of Windows Services for Unix is pretty darn good.
Got something to add? Send me email.
(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version
Increase ad revenue 50-250% with Ezoic
Inexpensive and informative Apple related e-books:
Take Control of Upgrading to El Capitan
Photos for Mac: A Take Control Crash Course
Are Your Bits Flipped?
Take Control of the Mac Command Line with Terminal, Second Edition
Take Control of Preview