Installing the i3 Tiling Window Manager on Ubuntu Server

I get quite a few search hits for “i3 Ubuntu” coming to this site because of an article I wrote back in 2016, so I thought I’d write a slightly more up-to-date version.

This article covers:

  • Installing Ubuntu Server on a Hyper-V virtual machine under Windows 10;
  • Installing the i3 window manager on Ubuntu Server;
  • Basic i3 usage.

But before we start – what is i3? What is a tiling window manager?

Unlike Windows, Linux allows the choice of different window managers. Many (most?) of these are comparable to how windows on Windows work: use the mouse to drag windows around, resize them, focus them, etc. And while these traditional window managers make getting started easy, they tend to have a couple of downsides: they often support keyboard-only operation only as an afterthought, and they can be fairly heavyweight in terms of system resources required.

i3 however takes a different approach: instead of letting you position windows anywhere using a mouse, it takes more control over the position of the windows and tiles them across the screen. Windows may be repositioned and resized using keyboard commands. If you don’t like moving your hands between the keyboard and mouse, i3 is an ideal choice: it provides a windowing system, but is very much a keyboard-first system. i3 is also a very minimal system that doesn’t require much in the way of system resources.

Getting set up with Windows 10 Hyper-V

For this article I will be installing Ubuntu Server as a virtual machine running on Window 10’s Hyper-V manager. If you already have Ubuntu Server installed somewhere, or if you aren’t planning to install it on a VM, you can skip this section.

First, go to the “Turn Windows features on or off” control panel. (You can press the Windows key and simply start typing the name of the control panel to find it in your Start menu).

Make sure the “Hyper-V” checkboxes are ticked:

Turn Windows features on or off - Hyper-V

If they’re already ticked, great! You have Hyper-V installed and ready to use. If not, tick the box, click OK, and be prepared to reboot your PC.

Once installed, launch the “Hyper-V Manager” - again, simply type on the Start menu to find it.

Hyper-V Manager

Before you can set a virtual machine up, you’ll need to download the Ubuntu Server installation media.

Browse to: https://ubuntu.com/download/server

… then choose option 3 “Download and install Ubuntu Server 20.04 LTS using a USB stick or a DVD burner”. You need to click the “Option 3” button again and the download will start - it’s just short of a gigabyte and you will have a .iso file downloaded.

Now, back to the Hyper-V manager. Create a new virtual machine, and give it a suitable name.

For “Specify Generation”, choose generation 2:

New virtual machine - generation 2

When assigning memory, choose at least 4096 MB:

New virtual machine - assign memory

For “Configure Networking”, you will probably want “Default Switch”, so the virtual machine is able to download the software you wish to install:

New virtual machine - configure networking

Next, put the ISO in the virtual DVD drive:

New virtual machine - insert ISO

Before you launch the virtual machine however, there is one last piece of configuration you need to do. Right-click the virtual machine and choose “Settings…”.

You must untick “Enable Secure Boot”. If you forget to do this you will get the following error when booting the VM:

The image's hash and certificate are not allowed.

New virtual machine - disable secure boot

You should now see the Ubuntu Server installation screens. What you enter there is specific to you. After a while, once the OS is installed, you will be prompted to reboot, remove the virtual ISO disk, and finally you should be able to log in to the VM.

Before launching the machine, connect the Ubuntu ISO as the IDE secondary.

Once the OS is installed and you have removed the ISO and rebooted, you can start installing software.

Note - you may need to hit “enter” to get to a login prompt once the system has booted.

(And one final hint – if you unpin the blue connection bar at the top, you can hit Ctrl+Alt+Pause to show it again).

Installing i3

First, update the system to get all the available system updates:

sudo apt update
sudo apt upgrade

(apt update gets the list of available updates and apt upgrade actually applies the available updates).

Next, install i3:

sudo apt install i3

i3 runs under X Windows so we need to install that:

sudo apt install xorg

Finally, configure your X session to use i3:

echo "exec i3" >> ~/.xinitrc

With everything installed, start X Windows which will now use i3 as the window manager:

startx

i3 will ask you a couple of questions, one of which will be whether to use the Windows key, or the Alt key, as the modifier. In the examples below I am assuming you have chosen the Windows key; if you chose Alt then simply substitute that in the examples below.

What should appear now will be a rather inscrutable nearly-blank screen:

The first nearly-blank screen shown by i3.

To get started, launch a terminal window with Windows+Enter. You should see a fairly old-style terminal window appear, covering the entire screen.

Using i3

Let’s explore a few concepts in i3.

Assuming you have the one terminal window open, hit Windows+Enter three more times. You should see four terminals, laid out in columns.

Four terminal windows laid out in columns.

Hit Windows+E to toggle between columns of windows and rows of windows:

Four terminal windows laid out in rows.

Here are some other keyboard shortcuts to get you started;

Key Action
Windows+Enter Launch terminal
Windows+D Launch application
Windows+E Toggle default layouts
Windows+F Toggle windows fullscreen
Windows+Shift+Q Close window
Windows+<Arrow Key> Focus adjacent window
Windows+<0-9> Switch workspace
Windows+Shift+<0-9> Move window to workspace

That’s probably enough for one article. Next post: customizing i3.

Published: Friday, October 09, 2020

Pinterest
Reddit
Hacker News

You may be interested in...

Hackification.io is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. I may earn a small commission for my endorsement, recommendation, testimonial, and/or link to any products or services from this website.

Comments? Questions?