Monday 2 August 2021

Installing Wine, the Windows compatibility layer within the Crostini Linux environment on a Chromebook, and running Windows astronomy software

Installing Wine, the Windows compatibility layer within the Crostini Linux environment on a Chromebook.


There is software for Linux called Wine. This is software written for UNIX type operating systems that allows you to run many Windows programs under Linux. The name ‘Wine’ originally stood for ‘Windows Emulator’. However, its developers realised that this is a misnomer because no code emulation or virtualisation takes place when a Windows program runs in Wine. These days, the word ‘Wine’ is used as a recursive acronym that stands for ‘Wine Is Not an Emulator’. It is a Windows compatibility layer that allows Windows programs to run on a POSIX compliant operating system such as Linux. Unlike a virtual machine which emulates internal Windows logic, Wine translates Windows API calls into POSIX calls so that the Windows software runs under Linux without the performance and memory penalties inherent in emulation. Not all Windows programs run under Wine, but many of them do.

Installing wine on your Chromebook Linux is done in two simple stages:

First the installation of Wine.

Launch the Linux terminal and type sudo apt install wine

Then Press Enter.

A number of lines of text will appear in the terminal window and it will stop with a [Y/n] choice as to whether to proceed or not.

Type y

Then more lines of text will appear in the terminal and will continue until the process finishes and you get the prompt:

:~$


Second enabling the 32-bit wine libraries

Type into the terminal sudo dpkg --add-architecture i386

Then type sudo apt update

The type sudo apt install wine32

Several lines of text will appear in the terminal window and you will be presented with a [Y/n] choice as to whether to proceed.

Type y

Then more lines of text will appear in the terminal and will continue until the process finishes and you get the prompt:

:~$

Wine is now installed on your Chromebook and you will be able to run a number of Windows astronomy programs such as Registax 5.1, Autostakkert! 2 and Iris.

A few words about Windows programs

Windows programs fall into two categories:

First; those that install fully and their component files are scattered across various parts of the Windows system. Registax 5.1 is an example of this type of Windows program.

Second; those that do not install in the normal way. The executable and its dependencies are saved into a single folder. In Windows, the program is launched by double clicking on the executable. Autostakkert! 2 and Iris are examples of this type of Windows program.


Installing Registax 5.1

First download Registax to the Downloads folder and then copy it over to Linux files.

Launch the terminal and type ls at the :~$ prompt

This is a command to list the files in the directory (folder).


Somewhere in the directory you will see the name setupregistax5_1.exe

Because we are in the folder containing this file, we simply have to type at the :~$ prompt:

wine setupregistax5_1.exe

Registax will install exactly as it does in Windows, as you can see happening in the previous screenshot.

Once the installation has finished, Registax 5.1 will be available to use.

Launching Registax 5.1 (or any other program that installs normally).

This may seem a little daunting the first time you do it, but it will become second nature after you have used the terminal and command line a few times.

I will explain what is happening, step by step in this terminal session to launch Registax 5.1

Launch the terminal and type cd .wine at the :~$ prompt

This command tells the system to cd (change directory(folder) to the .wine folder).

The prompt has now changed to .wine$ because we are now in the .wine folder.

Type ls to list everything in the wine directory.

We can see that there are 5 items in the wine directory, and one of them is drive_c

Type cd drive_c to tell the system to change to the drive_c directory

The prompt has now changed to .wine/drive_c$

We now type ls to list everything in the drive_c directory

We can see that there are 5 items in the drive_c directory and one of them is the directory 

‘Program Files (x86)’.

Type cd ‘Program Files (x86)’ to tell the system to change to the ‘Program Files (x86)’ directory. The quote marks are essential when they are given.

The prompt has now changed to .wine/drive_c/Program Files (x86)$

Again we type ls to list everything that is in the ‘Program Files (x86)’ directory.

We can see that there are 5 items in the ‘Program Files (x86)’ directory and one of them is the directory ‘RegiStax 5_1’.

Type cd ‘RegiStax 5_1’ to tell the system to change to the ‘RegiStax 5_1’ directory.

The prompt has now changed to:

 .wine/drive_c/Program Files (x86)/RegiStax 5_1$

Then type ls to list everything in the ‘RegiStax 5_1’ directory.

We can see that there are 6 items in the ‘RegiStax 5_1’ directory, and that one of them is RegiStax5_1Final.exe.

To Launch Registax 5.1 simply type:

wine RegiStax5_1Final.exe

Registax 5.1 will then run as normal.




Preparing a program like Autostakkert!2 that doesn’t install like Registax.

The first thing to do is to download Autostakkert! 2 (or any other program that doesn’t have to install in order to be used; such a program is Iris)

AutoStakkert 2.6.8 is the version we have found to work and is downloaded as a zip file to the Downloads folder on your Chromebook.

In the Linux Files folder, right click and create a new folder and call it AutoStakkert2

Double click on the AutoStakkert 2.6.8 zip file in your Downloads folder. It will open up and show you four files. Click on each of the files to select them as shown below:


Right click on the selected files and select Copy.

Then open the Linux files folder and double click on the folder you created called AutoStakkert2.

When the folder opens, right click inside it and choose Paste. The 4 files for the AutoStakkert! 2 application will be copied into the folder.

AutoStakkert! 2 is now ready to use.

Launching AutoStakkert! 2

Open a terminal and type ls at the :~$ prompt, to list the items in the Linux files folder.

One of the items will be a folder (directory) called AutoStakkert2; this is the folder that you created, and into which you copied the AutoStakkert 2 files.

Type cd AutoStakkert2 to change directory to the AutoStakkert2 directory

The prompt will change to /AutoStakkert2$

Type ls to list the items in the AutoStakkert2 directory

There will be six items in the directory and one of them is the executable

AutoStakkert.exe

Type wine AutoStakkert.exe

And AutoStakkert2 will launch


Practice launching Registax and AutoStakkert a few times and it will become second nature.


A few words about using the terminal and the command line.

It may seem a little daunting to use the terminal and the command line, but it shouldn’t be. Early personal computers in the 1980’s used operating systems such as DOS and CPM. Ordinary home users of these computers only had the command line with which to get anything done. There was no such thing as Windows and GUIs but the users of these operating systems found no difficulty in using them.

Modern users of Linux, macOS and Windows all have a terminal and command line that they can use, but for most people it is not necessary, and many are even unaware of their existence. Linux users are more likely to use the terminal and command line on a regular basis, but even for them, it is not essential.

The Chromebook is a Linux machine inside which is another Linux virtual machine, Crostini, that we are using here. It is a simple matter to get our programs launched from the terminal and command line, all it takes is a little practice.

The computer is pedantic and requires everything to be typed in correctly. If quotes are required, they must be there; the case of letters matters and spaces are important where required. If you find that anything doesn't work, it is because you have made a mistake in your typing. To have another go at a line which has just failed, just press the UP cursor key and the line will re-appear as you typed it; just examine it carefully to find the typing error you have possibly made. Correct the error and press Enter. It will now execute correctly.