Skip to content

Liquid Galaxy

Mahinour Elsarky edited this page Aug 24, 2024 · 4 revisions

About Liquid Galaxy:

The Liquid Galaxy is an open source project founded by Google and created by Google employee Jason Holt in 2008. Liquid Galaxy started out as a panoramic multi-display Google Earth viewer, but has evolved to become a general data visualization tool for operations, marketing and research. It gives a unique experience to allow users to fly around Google Earth, view photos, screen layouts, balloons, placemarks and develop interactive tours.

Liquid Galaxy consists of 3 or more computers for multiple displays, and each computer manages a display. It depends on a master/slave architecture where the master is responsible for receiving all information and replicating it to the other nodes using SSH message passing, allowing the screens to behave in a synchronized manner. You can find more about Liquid Galaxy from here

Liquid Galaxy Image

Setting up a Liquid Galaxy System on your machine

Step 1: install ubuntu image from the drive link

Step 2: Install Virtual Box

Step 3: Configuring NAT Network

  • In the Virtual box we go to NAT Network, right click and create
  • Enable IPV6
  • In prefix: 21da:d3:0:2f3b::/64

Step 4: Set up the LGs

  • We begin with the master: Add

  • Fill in info: Name(lg1) Image(ubuntu image)

  • check unattended installation

  • Ram: 1800

  • Choose 1 CPU **however if crashed, we can increase the cores more

  • Memory: 18GB

  • We do the same for LG2 and LG3 with respective names

Step 5: Enable Nat Network on 3 LGs

  • Always start with Master (Lg1)
  • From settings -> Network -> adaptor1 -> Nat Network
  • Do the same for LG2 and LG3

Step 6: LG Installation

power up all 3 machines and do the following (always starting with master):

  • Select install ubuntu
  • check all
  • choose something else
  • New partition
  • Click on plus button then swap area with size 1024
  • Then plus again and choose /
  • Install now
  • Do the same for all LGs
  • Name: lg computer name: lg1 lg2 lg3 respectively, username: lg, password: ***

Note that username and password has to be the same on all 3 machines

Step 7: update and upgrade:

  • Ctrl alt t to open terminal in all 3
  • On all 3 machines install and update everything by:
sudo apt update && sudo apt upgrade -f
  • Press Yes or Y
  • On all 3 machines install curl:
sudo apt install curl lsb lsb-core

Step 8: Run LG Script on Master machine

  • Open Firefox on all 3 and search for liquid galaxy github
  • copy the script and paste it on Master first:
bash <(curl -s https://raw.githubusercontent.com/LiquidGalaxyLAB/liquid-galaxy/master/install.sh)
  • Machine ID:1
  • Save the IP for later (very important)
  • total machine count:3
  • unique number: 69 or (42)
  • no extra drivers
  • continue and when ask for ssh just ignore press enter and enter

After LG1 finish, don’t press enter to reboot, just from options shut down urself and reboot. Bec rebooting using script sometimes have bugs and cause problems sometiemes

This will open google earth after reboot for LG1. This means installation was successful. If not, you have to redo the installation and make sure you have a good internet connection

Step 9: Run LG Script on Lg2 and Lg3

  • Go to Lg2 and do the exact same
  • Machine ID:2 for LG2 ad Machine ID:3 for LG3
  • Master Machine IP: The saved one from the previous step
  • Unique number: 69
  • No drivers
  • Now we reboot 2 then 3 using the same way

Step 10: Relaunch

  • On Master type the following command:
 lg-relaunch
  • View scaled mode.
  • Now you will see all 3 machines synched together successfully!
  • If you have any errors, please redo the installation with good internet connection.

Step 11: Enable Host-Only Network

  • Shutdown after sending power off signal for the 3 machines
  • Go to tools of VBox, network tab and host-only networks
  • Right-click to create a new one
  • Go to MASTER and then settings network adapter 2 and choose host-only adapter

It connects the network with the master, and slaves will follow along

For more information please check up the Liquid Galaxy Installation Guide and The Training Provided


Common Liquid Galaxy Commands to Control the LG:


Relaunch Command

You can implement a “for loop” for the amount of screen number you have (i.e: 3) then execute:

"'/home/$user/bin/lg-relaunch' > /home/$user/log.txt"

Then execute :

"""RELAUNCH_CMD="\\
if [ -f /etc/init/lxdm.conf ]; then
  export SERVICE=lxdm
elif [ -f /etc/init/lightdm.conf ]; then
  export SERVICE=lightdm
else
  exit 1
fi
if  [[ \\\$(service \\\$SERVICE status) =~ 'stop' ]]; then
  echo $pw | sudo -S service \\\${SERVICE} start
else
  echo $pw | sudo -S service \\\${SERVICE} restart
fi
" && sshpass -p $pw ssh -x -t lg@lg$i "\$RELAUNCH_CMD\"""

Where you can change $user with the username of the LG machine, and $pw is the password of the LG machine, while $i represents the lg machine which is specified in the for loop.


The Reboot Command

You can implement a “for loop” for the amount of screen number you have (i.e: 3) then execute:

'sshpass -p $pw ssh -t lg$i "echo $pw | sudo -S reboot"'

Where you can change $pw with the password of the LG machine, while $i represents the lg machine you specified in the for loop

Example of the function with the for loop:

Future<void> reboot() async {
    final pw = _sshData.passwordOrKey;
    final user = _sshData.username;

    final result = await getScreenAmount();
    if (result != null) {
      screenAmount = int.parse(result);
    }

    for (var i = screenAmount; i >= 1; i--) {
      try {
        await _sshData
            .execute('sshpass -p $pw ssh -t lg$i "echo $pw | sudo -S reboot"');
      } catch (e) {
        // ignore: avoid_print
        print(e);
      }
    }
  }

The shutDown command:

You can implement a “for loop” for the amount of screen number you have (i.e: 3) then execute:

'sshpass -p $pw ssh -t lg$i "echo $pw | sudo -S poweroff"'

Where you can change $pw with the password of the LG machine, while $i represents the lg machine you specified in the for loop


Puts the given content into the /tmp/query.txt file

'echo "$content" > /tmp/query.txt'

Where you can change $content with the content you want to execute in /tmp/query.txt


Sending KML to slave machine:

"echo '$content' > /var/www/html/kml/slave_$screen.kml"

Where you can change $content with the content you want to execute in on slave machine, and $screen with the slave screen number