Teach Linux To Do Windows, Part 2

Part One

To get the most from this Recipe, read Part One first. Also, you must have Linux running on a system before you can install Win4Lin. Assuming you've done both, let's jump in.

The following is a rough summary of what's described in the Win4Lin docs. This is intended to give you an idea of what you are doing; for more precise information, read the manual. Also, if you are reading the manual from Acrobat for Linux (as you should be), don't worry about starting X-Windows; it's already up.

Win4Lin Installation

I. CD Version:

id
unit-1659132512259
type
Sponsored post

II. Downloadable version:

If all goes well, your installation is as simple as that.

Below is the Win4Lin installation screen showing where you have to choose to download the files you will need to complete the Win4Lin installation.

Unless you already know you have the packages available (e.g., on your CD) and current, click the odd looking checkbox where the arrow points and make sure it is active, as shown below.

The installer first checks to see if the installer itself is current, then it asks whether or not the user wants to download the files required to install Win4Lin. Select Next to download the files. You will see two progress bars as illustrated in the image, one for the Win4Lin file, the second for the kernel if you need to install one. The first file is Win4Lin, about 2 MB; the second is around 16 MB.

If the download is interrupted for any reason, then the installer will crash without warning or visible onscreen indication. If the modem lights aren't flashing and/or the installer progress bar doesn't move after a few minutes, log out of the system to the login prompt and restart it. If you know how to use the ps and kill commands, find the installer process and kill -9 it instead.

Once you're back up, reconnect to your ISP and restart the installer. The installer will check the files, finish downloading Win4lin, and start downloading the modified kernel, if required.

Once the Win4Lin software is installed, you will be prompted to perform the steps required to install Windows. Once the Windows files are loaded, the Windows installation process will take place as you remember it, only faster. The installation process thinks it is installing on a virtual computer and knows nothing about Linux.

Note: A printer should work fine from Windows/Win4Lin, assuming you already have the printer set up in Linux.

Connecting to the Internet via Win4Lin

Assuming you use the default network installation using Winsock 2 (strongly recommended), here's how to connect to the Internet via Win4Lin:

At this point, you should be fully connected for either Windows or Linux network applications You can open and close your connection or Network Device Control as you please. If you reboot Windows, you'll need to reopen Network Device Control and open a Windows network client.

If You Can't Connect to the Net After Installing

Connecting to the Net should not be a problem for users running a 2.6.x kernel. Netraverse plans to make a modified 2.6.7 kernel that should fix the problems described below available shortly after this article is complete, perhaps even before you read this. If you don't have any problems, skip this section and go directly to "Now that you have Win4Lin installed" section below.

I. Fixing the dialer / network local connection:

When I tried Network Device Control (also connects to Ethernet LANs, VPNs, etc.) it refused to open. Here is what Netraverse recommended doing about this problem, which appears to be due to configuration errors in the Win4Lin software installation:

Network Device Control patch

II. Getting connected to the Internet:

Here is the Win4Lin network driver patch:

(Thanks to the Netraverse support people and their director of software engineering for providing these patches.)

Now That You Have Win4Lin Installed...

Here's how to move your files to your Linux installation. The approach is simply to copy the directory tree into the Win4Lin/Windows environment.

Start by changing to the directory in which your Windows drive is mounted. Note that "windows" here means whatever you decided to call your Windows drive.

cd /mnt/windows

For instance, use cp for copy:

[root@terrarium windows]# cp -r,reply=no [a-vA-Vx-zX-Z0-9]* /home/alizard/win

This instructed the computer to copy all the directories and subdirectories and files from the Windows to the win directory--which Win4Lin/Windows sees as the C: drive--except for ones starting with the letter W. You do NOT want to copy the Windows directory, Win4Lin requires a fresh installation of Windows.

There is one problem with this, however. For reasons having to do with the way Linux treats the Windows file system as foreign, all files on the original file system belong to owner=root , group=root. That means that only the root owner can do anything with the files. You will not be running as root for anything but system administration operations.

One fix is to change the file ownership:

cd /home/username

chown -R username:username win

(chown means change ownership, *nix files have ownership metadata which governs access)

And change the read/write/execute permissions:

chmod -R 755 win

To move the non-Windows files starting with either upper-case or lower-case W, use the superuser file manager: Start - System Tools - More System Tools > File Manager - Super User Mode . Highlight the directories and files you want to move and move them to /home/username/win .

Installation: Windows Applications Under Win4Lin

In general, installing Windows applications over Win4Lin is exactly like installing them in an ordinary Windows environment. However, moving your stuff into the Win4Lin environment will be more like moving into a new house than your previous experiences with system upgrades.

In your previous upgrades from one version of Windows to another, you generally simply installed over previous Windows installations. The great majority of legacy applications worked fine and didn't need to be reinstalled.

But in a Win4Lin installation, all the Windows applications will have to be reinstalled with the exceptions described below. You will have to pick and choose what to install. You will have to choose how to define or redefine your new dataspace just as you would define / redefine your physical space when moving into a house.

I copied my entire Windows C: drive directory tree except for Windows over to the new Linux drive under the /win directory Linux creates. Applications are not automatically installed, though any application that is self-contained and doesn't need Windows Registry entries or DLLs that don't exist in C: > windows > system will run with a new Desktop pif shortcut. Quite a few utility programs fit this description.

Don't bother with third-party Windows file managers, as they don't work.

If you obtained a significant number of your Windows applications via download, install WinZip first so you can go to your download directory and unzip / install your applications.

When installing Office 97, remember to use a custom installation and open Office Tools and uncheck Office Assistant. Unless you're in the small minority that likes Clippy.

Here are some screen shots illustrating my installation. The first shows my initial working environment with the default Win4Lin/Windows install, default KDE desktop, and multiple Windows programs running.

The next screen shot displays Corel Draw in operation:

Next, here's Microsoft Word at work.

Next, here's Paint Shop Pro shown in use:

The next screen shot shows Eudora working with my legacy Windows Eudora mailbox files. The ability to do this was one of my primary reasons for going with Win4Lin:

What is particularly significant about the above is that three out of the four programs shown do not work with Wine/Codeweavers Windows emulation.

Don't assume that you automatically need to reinstall all the old Windows applications from your old Windows environment. Remember, the idea is to learn Linux. So use Linux applications in preference to Windows applications whenever possible. Also, the more applications you can run from Linux, the more productive you are likely to be when the Windows part of the system is too busy executing operations to accept any input from you.

That said, your Windows OS will be quite a bit stabler than it used to be once you find a significant number of Linux replacements -- ideally, ports of your Windows software -- running in place of Windows applications.

Every application that is running as native Linux instead of in Windows is not consuming Windows resources. Having two dozen subwindows in Opera open doesn't destabilize Linux significantly. But not having it run in Windows stabilized the legacy OS quite a bit.

If you've had your Windows environment for any length of time, you also have many desktop icons attached to programs or files/directories, but no idea exactly why you decided to put them there because you haven't used them in years. The next screen shot shows my old Windows desktop. See what I mean?

Like a move, this gives you a chance to leave behind a lot of accumulated dross. Install the handful of applications you really need immediately, along with a few files/folders relating to current projects, and install only what you need when you need it. Also, check for Linux applications first if you think you need to install a Linux application when time allows. There is also a good chance that many of the major applications you depend on will be ported or that Linux applications with acceptable functionality and legacy compatibility will appear. Your distribution probably has a whole lot of applications you haven't installed available for download and a setup for automatically downloading and installing them. Find out what it is, and learn how to use it.

Here are the main differences between Win4Lin/Windows and a native Windows installation:

Here is a screen shot of the new Win4Lin/Windows desktop running over Linux shortly after installation:

Backups

Windows backups do not work with the Win4Lin environment. Whatever Windows on Win4Lin thinks, you no longer have access to a DOS/Windows file system. The good news is, neither do viruses.

While one can transfer the data from your Linux drive to a mirror drive by simply doing a cp operation, to make a bootable drive clone as you can a Windows drive is a far more complex problem. One would automatically have to create a set of drive partitions identical to that of the drive to be cloned, then stuff the right data into each partition. There are packages that will copy everything, including partitions, but I did not test them for this Recipe.

I'm also looking for a Linux equivalent of ZipBackup to allow converting the contents of my Linux drive to archivally compressed DVD-R size chunks.

To back up to a blank hard drive available from Linux, first:

cd /mnt

make the new directory to mount the backup drive to:

mkdir linux_backup

follow these instructions from About.com from Steps 1 to 5.

For this, you only need a single Linux partition. To mount the backup drive once it's formatted:

mount - t ext2 /dev/hdd1 /mnt/linux_backup

linux_backup means whatever you thought was a good volume name for your backup drive. The rest of the About.com article isn't relevant, since you're creating a data drive, not a boot drive. If you are using ext3 or other kind of filesystem instead of ext2, type in the right filesystem descriptor instead.

Get help with respect to the fdisk part if you have any doubts of your being able to carry it through once you've gotten to the menu part of fdisk.

cp is like the DOS copy command:

cp -au --reply=yes /bin /dev /home /lib /misc /opt /root /selinux /tmp /var /boot /etc /initrd /lost found /proc /sbin /sys /usr /mnt/linux_backup

cp is in source-destination format. Everything before the /new-disk is source. So the command means to copy updated files recursively (down the directory tree) from your working Linux drive to the backup drive linux_backup.mounted temporarily as a directory in the Linux filesystem and write new ones where they don't already exist.

Note: /win4lin-download is where I put the Netraverse downloads. The CD may install it somewhere else; if that happens, either change /win4lin-download to fit, or, if it's a subdirectory of any of the listed directories, omit it.

To restore an entire drive, install or reinstall Linux to a drive, mount your backup drive as described above, cd to it, and then:

cp -au --reply=yes /bin /dev /home /lib /misc /opt /root /selinux /tmp /var /boot /etc /initrd /lost found /proc /sbin /sys /usr

/

/ is itself a directory name, of the top-level directory. The command says take the listed main directories from the main directory tree on the linux backup drive -- not mentioned because you are doing this from that drive -- to the directory / on your primary Linux drive.

The list between - au and / should include all the top-level directories of your hard drive except /proc and /mnt.

, /proc contains temporary processes, and /mnt contains the drives that are temporarily mounted/unmounted, including your backup drive.

You don't want to copy a hard drive into itself. This is why you leave /mnt out of the restore command.

Remaining Problems

These are the most important problems I've found with this combination as installed:

Conclusions

Below, a screen shot showing what my Linux / Win4Lin desktop looks like now. Eye candy aside, this is more functional than the Windows Desktop it replaces. My most used applications are in the taskbar, but only the needed ones are started at startup. The taskbar program tabs stay the same size regardless of the number of GUI programs running. The clock is a lot more visible than it used to be.

Once the setup is done, it all works very well. I think it was completely worth the effort. While dialing in this system was not easy, now I no longer have to devote the average of half an hour a day to rebooting or changing Windows system settings to keep it operational. Nor do I have to put up with the intense annoyance at the inability to do anything useful while putting in this penalty time.

If you try this, you should have a far easier time than I did, since you'll have this Recipe to refer to. The problems discussed here will be fixed over time. Meantime, this article is written for those of us who will actually have to know how Linux desktops work, including the guts which our users will come to us for help with when point-and-click stops working -- just as they do with Windows now.

Sidebar: Where To Go If You Run Into Trouble

This is Part Two of a two-part Recipe. View Part One here.

A. LIZARD is an Internet consultant in the San Francisco Bay Area who has written for technology magazines and Web sites since 1987. He thanks Maxtor and Netraverse for contributing a pair of hard drives and a review copy of Win4Lin, respectively, for use in this Recipe.

Discuss this Recipe with other system builders in the TechBuilder Recipe Forum.