Dual boot UEFI Windows 10/Linux Mint 19.3 system

1

After 2 years without Windows, I decided to assemble a desktop with dual Windows 10 / Linux Mint 19.3 boot. I remember making Windows/Ubuntu dual boot system was a pain in the ass since UEFI replaced good old BIOS; but times changed, and I was surprised how smooth and easy is making UEFI dual boot system now.

I used ASUS PRIME 365M-K motherboard for my desktop; I think all modern ASUS motherboards have the same UEFI support.

You install Windows 10 first. I used brand new HDD, and I allocated half of HDD for Windows and left the rest of HDD unpartitioned. Windows created several partitions in the allocated area, the most important for dual boot is EFI partition which Windows labelled “System” or like that; it will be relabelled as “EFI” subsequently by Linux Mint installation program.

Now you install Linux Mint 19.3. When asked how to install Linux Mint, I have chosen default “Install alongside Windows” option. This is a preferable option unless you want a third system on your HDD.

If you google “Dual boot Windows Ubuntu UEFI” now, you probably find recommendations to disable Secure boot and do other strange things. I believe this staff is outdated for modern hardware and latest Ubuntu or Mint versions, and all you need is just run installation programs.

Linux Mint 18 and UEFI boot manager

1

Recently I was installing Linux Mint on a new Acer laptop with UEFI boot manager. The laptop came with preinstalled “Endless OS” which turned out to be useless because of absence of a package manager. I’ve created Linux Mint 18.3 bootable USB using Rufus, and chosen “GPT partition scheme for UEFI”. I did not make any BIOS changes before installation, and the installation procedure worked fine; I’ve chosen “Erase the entire disk” option during installation. After the installation, when I tried to launch the newly installed OS, I’ve got “No Bootable Device” screen. After several “try and error” iterations I came with the following solution:

  • During installation, do not check “Install 3rd party drivers …” option – the drivers will not be installed anyway; they can be installed later using Driver Manager.
  • After the installation is over, boot into BIOS settings (on Acer laptops by pressing F2 key after switching power on) and set the EFI file created during installation as trusted. The procedure is written in much detail here, only in my case the file turned out to be grubx64.efi
  • The system should boot now, but without some drivers. The worst thing in my case appeared after installing Oracle’s Virtual Box – Virtual Box installs it’s own kernel driver, and Virtual Box did not work because the driver did not work. So you need to enable driver installation now, and it is done by disabling “Secure Boot” option in BIOS.

Crosscompiling with Lazarus 1.8 on Linux Mint 18.3

0

Suppose you installed Lazarus 1.8 on Linux Mint 18.3 as described before and want to build Windows binaries (well we don’t like Windows, but the users do 🙂 ). I’ve found the useful piece of information about crosscompiling here and started to adopt it to my 32-bit Linux system.

The first step is to build and install the crosscompiler. For the demonstration purposes I decided to build Win32 crosscompiler (the Win64 case should not be much different).

Lazarus 1.8 uses FPC version 3.0.4, so to perform the first step open up Terminal and execute following commands:

# Navigate to the fpc source folder.
cd /usr/share/fpcsrc/3.0.4

# Compile the cross-compiler.
sudo make clean all OS_TARGET=win32 CPU_TARGET=i386

# Install the cross-compiler.
sudo make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=/usr

# Link the cross-compiler and place the link where Lazarus can see it.
sudo ln -sf /usr/lib/fpc/3.0.4/ppcross386 /usr/bin/ppcross386

Now let us open Lazarus and create a simple GUI project. I dropped a button on the form and written OnClick handler:

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('Hello World!');
end;

I created subfolder /Projects/Lazarus/HelloWorldGUI in my home folder and saved the project under the name HelloW. You can build and run the project and see it works.

Now time to configure the project for Win32 crosscompiling. Open Project Options dialog (Ctrl-Shift-F11). You should see this:

Options0

Check Build Modes checkbox:

Options1

and click the ellipsis button; a new dialog appears:

BuildMode0

Click plus button to create a new build mode, and name it Win32:

BuildMode1

Now we should tell Lazarus to compile Win32 code for this build mode. Select Config and Target on the left panel and select Win32 as target OS:

ConfigWin32

Now you can build the project. I simply clicked green Run button and obtained the warning window:

DebugErr

Well I guess one can’t expect to debug Win32 binary on Linux. Still the work was done, and I’ve found HelloW.exe file in the project folder. To be sure I’ve copied the file on 64-bit Windows 10 system, and It Works!

CrossWin32

Installing Lazarus 1.8 on Linux Mint 18.3

4

Yesterday I come across my old 32-bit Celeron laptop with 2Gb memory and broken battery and decided to install Linux on it. First I tried Centos 7.5, then Ubuntu 16.04, and finally settled down on Mint 18.3 Cinnamon which I liked most. After playing a little with the OS I decided to install the brand new Lazarus 1.8. I spent a couple of hours searching for a clear installation guide in Internet; I scanned tons of outdated nonsense before I finally found what I was looking for.

My Linux Mint installation was fresh, and I need not purge it from previous fpc/lazarus installations. So I started from downloading three 32-bit .deb packages from sourceforge.

After downloading my Downloads folder looked so:

Downloads

The next recommended step is to check hashes of the files. I launched Terminal and changed to Downloads directory:

hashes2

Now time to install the packages. As recommended in the linked guide, I typed in Terminal

sudo apt install ./fpc_3.0.4-1_i386.deb
sudo apt install ./fpc-src_3.0.4-1_i386.deb
sudo apt install ./lazarus-project_1.8.0.0_i386.deb
sudo apt-mark hold fpc fpc-src lazarus lazarus-project

And that is all! After opening the Cinnamon menu I’ve found this:

menu