Fast virtualized environment with UI using i3

Continuing with a description of the setup I use for my development, here I will comment about my current configuration files for a virtualized environment using UI.

I rarely use the VM via the UI (i.e. the mouse), and there can pass several weeks when I don't open enable it even once. However, there are times when some tools are too UI dependent and the time constraints force to use a desktop manager for the virtual machine, instead of the normal approach of configuring the tool to be used from the host OS (including coding via SSH, Tmux and Vim).

One example of easy integration between my virtual machine and the host OS is MySQL Workbench, where it is simple to configure connections from the host (e.g. Windows OS) to the MySQL service running in the virtual machine. The same applies to anything that works via RESTful API really (e.g. servers), but one example where I decided to use the UI directly in the VM was running some Selenium integration tests.

Because the host OS is already consuming a lot of memory, I looked for lightweight solutions for this. One option was Lubuntu, which is a fast distribution similar to the widely popular Ubuntu, but decided to just use i3 which can be integrated with my OS of choice: Arch Linux. So far I am very pleased with this solution because it runs very smoothly, it is simple to configure and flexible.

The configuration files at the time of writing this article are:

Will comment about the most important points in both files.

Environment setup

  • The gui-extras block is optional and would only install it when working with specific languages (e.g. Java for eclim)
  • Terminator is a great base terminal manager. The UI looks better than the default terminal, even if I usually use only one terminal with Tmux
  • Some fonts are needed to have a correct display of Chinese characters on Chromium
  • With the dmenu plugin and the binding in the config file, open a new program is very fast, can type any fragment of the name (not fuzzy though)
  • Defined a few Bash aliases so there is no need to remember the specific commands
  • Is important to initialize the VBox config to support multiple monitor resolutions
  • One handy alias is ModifyI3Conf which will open the editor for the env file and copy it to the home directory when finished
  • Is important to setup correctly the keyboard layout when typing directly in the UI (as opposed with the SSH approach I normally use)
  • It also runs the fantastic VSCode editor in i3 inside the VM with excelent performance
  • The most important part is the exec i3 line in the ~/.xinitrc which is easy to forget after installing i3
  • Tried Alacritty but was not ready yet at that moment, sticking with Terminator for now

i3 config file

  • Using mostly the default bindings but for tile number transitioning, changed to right Alt as I am already using left Alt with AutoHotKey in the Host
  • Checking this file once in a while is very useful to remember some of the powerful forgotten shortcuts from i3

Resources:

Back to the posts list
Loading ...