Back to the main page

Floodgap's Power MachTen Hacking Page: User Tips, Tricks, Pitfalls, Skillz'n'at

This covers many important user tips and tricks, and a few known gotchas. If you're looking for a primer on building packages with MachTen, particularly things like crypto, OpenSSH, etc., go to the building packages to get your system up to snuff section.

What version is PowerMachTen really?

There is some argument over this. Although my CD and my manual all say 4.1.4, when you run uname -a, you get version 5.0.5. Only Tenon knows for sure, I guess. This is the highest version number I have seen.

What is the default root password?

MachTen comes with a couple default accounts, but most people will want just to log in as root and make their own. Appropriately, the password by default is MachTen.

Cursor keys don't work in the console terminal windows.

This is a known bug. Logging in remotely with ssh helps; see the building packages to get your system up to snuff section. (Interestingly, they will work if you ssh to yourself from the console terminal.)

My telnet session to my server intermittently locks up.

When you are connected over Telnet to a MachTen server with most modern telnet clients and you send something requiring a flush, such as CTRL-C, your session will appear to freeze. It's actually still there, but most clients are waiting for a timing mark and the MachTen telnetd never sends it. Blindly type logout and you should quit cleanly. This is another reason to build sshd (there's no point in fixing telnetd); see the building packages to get your system up to snuff section.

I can't figure out how to turn on the X server.

After you log in at the console, press Command-T to toggle X11 and X11 will enable itself (running AfterStep). The X server is run with a root window. If you switch to another Mac application, the root window will become invisible.

There is a bug where, if you log out with Command-Z while still in X11, the screen will not repaint properly. This is not serious, just annoying. To avoid this, close the root window first with Command-W (or File, Close Window).

The implementation of X11 in MachTen is one of its best features -- it is extremely fast and very capable. Motif libraries are included. It has many powerful options and you should read part 12 of the manual to appreciate them.

Do I want to be running cron?
... inetd?
... macmntd?
... wind?

In order: probably not, maybe, almost certainly, and definitely. wind is the MachTen window manager daemon, and it runs even when you're just at a text-console terminal window. Don't mess with it. macmntd handles automounting Mac volumes and you should be running it unless you have a good reason not to.

However, unlike most typical Unices, there is a good reason not to run cron and there are also reasons to consider when and when not to run inetd, and those are in the building packages to get your system up to snuff section.

I'm confused about how Power MachTen handles networking.

There are a couple of ways MachTen can see the network, and all of them are configured with MachTen shut down inside the Tenon Kernel Libraries folder in the MachTen folder itself.

Out of the box, MachTen is configured to tunnel its network through Open Transport (i.e., you see OTSocketLib in that folder, and SocketLib and MacTCPdLib are in the Disabled folder). This is almost always what you want and should be left alone. The disadvantage of this mode is that MachTen has no TCP stack of its own in the mode, only mapping its socket calls into OT calls, so things like netstat are completely useless. However, you can use any network device that Open Transport can see, and you can receive incoming connections if they are checked in the MachTen control panel.

You can also run MachTen in a dual stack configuration where regular Mac apps run through MacTCP or Open Transport, but MachTen uses its own TCP/IP stack (i.e., you see SocketLib in that folder). This typically requires that each stack run on its own interface, however, and I don't know how easily the stack can be fuzzed or pwned, so I don't recommend this (and it might not be compatible with every MacOS-compatible network device). The only reason you might want to use this is for multihoming, which Open Transport supports rather poorly; in that case, you will probably want to route between the stacks and that exercise is left to the reader.

The third mode is to tunnel Open Transport and MacTCP through MachTen. I strongly advise against this for various reasons including compatibility. If you really want to try that, though, have SocketLib and MacTCPdLib showing.

Okay, I have MachTen installed on my system, but my network uses DHCP.
Okay, I have MachTen installed on my system, but I have a wireless LAN.

As long as MachTen is tunneling through OpenTransport, any device that OT can use as a network interface, MachTen can too. This includes AirPort (and my blueberry clamshell G3 iBook now has my MachTen license and happily talks over AirPort to my local coffeeshop wireless). Thus, the real trick is getting MachTen to be happy as a DHCP client, and the way to get a DHCP lease and have MachTen use it is like so:

What are FFS files? Why does MachTen call it UFS, not HFS?

MachTen has a peculiarity of its documentation where HFS and HFS+ volumes are referred to in /etc/fstab as UFS. People who know, know HFS+ ain't UFS (and certainly not UFS in the sense that A/UX or Mac OS X would understand it), but that's just what they call it. There is no "true" Unix File System support in MachTen, only its emulated UFS-on-HFS support (which uses some tricks to make it case sensitive and a few other things).

Many of the core tools, however, live within FFS images. These are true Fast File System images and contain their own filesystems, and are maintained with fsck. In an FFS volume, the regular Mac filesystem limitations are done away with, and you can treat them like a regular BSD file system. DO NOT MODIFY THE FFS IMAGE FILE BACKING AN FFS VOLUME, OR YOU WILL FIND YOURSELF WITH A LOT FEWER FILES!

How do I access my Mac files from inside MachTen? (Related: how does MachTen handle HFS forks and resources?)

The easiest way is simply to mount your Mac volume as a "Unix" volume, either by putting an entry in /etc/fstab or calling mount (using filesystem ufs for Mac volumes), or just using // to get to the root folder of the volume MachTen is running from. (If you just want to get into MachTen's folder itself, use /MachTen_Folder.) Remember, MachTen calls Mac volumes ufs, not HFS.

Mac files are automatically turned into AppleSingle when they are read and separate forks when they are written by tools such as tar -- except if their creator is MUMM. In that case, the type code is important. If the type code is BINA, then MachTen treats them as "native" and leaves them alone, and MachTen utilities only operate on the data fork. This is the default type for files you create within MachTen. If the type code is TEXT, then MachTen will automatically translate carriage returns to line feeds for Unix tools, and then back to carriage returns so Macintosh apps will still read them correctly. If either of these have resource forks, they are ignored. (There are some other types corresponding to symlinks, block devices, pipes and such, but you can read about those in the manual.)

The dfork and rfork tools extract, respectively, only the data fork and resource forks from a file to standard output. Similarly, the finderinfo utility allows you to access Finder information such as type and creator (example: finderinfo -C MUMM -T TEXT lettertoobama.txt), and restool lets you merge resource forks together. There are man pages for all of these utilities.

Is there a MachTen FAQ?

Sort of. It is, however, woefully out of date.

You didn't answer my question.

So, nu, you want I should beat it out of you?

Or do you want to start building packages to get your system up to snuff?

Or did you want the main page?

Cameron Kaiser