2018-08-13

How to install GNOME on top of HDP Sandbox 2.6.5+

I have seen a great tutorial on how to configure your Hortonworks Sandbox to work with a UI. Unfortunately, it is obsolete from HDP 2.5+ because of some underlying changes of the sandbox itself, and the steps there are resulting in a broken Hortonworks Sandbox. Luckily I've managed to find a workaround, so if you're in dire need of the HDP Sandbox, but you also need an IDE to be running on top of it, than please, be my guest and follow the steps below:

DISCLAMER: I only tested it with Oracle VirtualBox, but I think that the steps for VMWare should be identical with the Oracle VirtualBox's description.

1. Download and Import the latest HDP Sandbox (2.6.5 at the time of writing) from https://hortonworks.com/downloads/#sandbox

2. Check and increase the size of the video memory. (I've set it to 64MB and it works like a charm)



3. Open the port forwarding settings and check the configuration.


You should be able to see that the advertised SSH connection (2222) actually connects to a docker on top of the VM, while the real SSH port has been mapped to (2122 and 2200). If these ports are changing over time, please use the ones in the new VM config. From here on out I'll only refer to the Docker SSH connection as 2222 and the VM SSH as 2122.

4. Add an optical drive to the VM's image (if you want to install Guest Additions to the VM)
I highly recommend doing so, since it will enable dynamic resizing and clipboard sharing amongst other things. Otherwise, you can skip this step. (You can add it later on as well, but it will require an additional restart)



5. Fire up the VM and wait until it initializes Once its done you should see the following screen:



5. Open an SSH connection
Once you see the welcoming screen, open a shell prompt and ssh into the host machine. The username-password combination is: root/hadoop (you'll know that you're using the right port if the prompt says sandbox-host instead of sandbox-hdp):

ssh root@localhost -p 2122




6. Update your VM
Now we'll need to make sure that every component on the VM is up to date:

yum update -y


7. Patching the VGA component
Here comes the tricky part. Without installing mesa-libEGL GNOME's VGA driver will fail to start. To fix this execute the following two commands:

yum install -y mesa-libEGL
ln -s /usr/lib/mesa/libEGL.so.1 /usr/lib


8. Install GNOME 
Now everything is set to install the packages with:

yum install -y kernel-devel

yum groupinstall -y "GNOME" "GNOME Desktop" "Graphical Administration Tools" "Development tools"


9. Set the VM's default startup from console to GUI:
systemctl set-default graphical.target


10. To Restart the VM from the ssh connection type in:
reboot now

After a few seconds you should be able to see the following screen:



The password for the packer user is packer.

+1. Setting up Guest Additions

Since we've already installed everything which is required to have the guest additions up and running all you need to do is to press the insert disk button, hit run, then restart the machine. (In some rare cases the UI can appear broken right after the Guest Additions are installed. If that's the case, you can restart the VM by using the ssh port used in the 1st part of this guide and use the reboot now command. After the reboot however everything should work as expected) To get the most out of your new environment I highly recommend to enable the shared clipboard functionality on the VM, which enables you to copy content from your host machine and paste it directly into the Hortonworks Sandbox.




That's it!
You're all set to use the Hortonworks Sandbox as your own mobile development environment with its own UI. If you have any questions, please let me know in the comment section below!

Remark: The same steps can be applied for HDF 3.1+

9 comments:

  1. Hello,

    Many thanks for this step-by-step tutorial; works like a charm!!

    BTW, one quick tip; in VirtualBox, if you change the network settings from "NAT" to "Bridged" and set "Promiscuous Mode" to "Allow All", then you can connect to the host (using SSH) via port 22 and hdp appliance (again using SSH) via port 2222. I've verified that this works consistently, even after reboots. Advantage of this approach is that it allows one or more users to connect to host/sandbox from different machines.

    Cheers & keep up the good work!

    ReplyDelete
  2. Brilliant, thank you for this blog post very much!

    ReplyDelete
  3. Hello, good job, it's work for me too. Just a problem with the VBoxLinuxAdditions, in a docker the kernels are not équal, uname -r give: 4.17.2-1.el7.elrepo.x86_64

    and the real kernel use is: 3.10.0-862.14.4.el7.x86_64

    so the VBox failed with :

    This system is currently not set up to build kernel modules.

    Please install the Linux kernel "header" files matching the current kernel

    for adding new hardware support to the system.

    The distribution packages containing the headers are probably:

    kernel-devel kernel-devel-4.17.2-1.el7.elrepo.x86_64

    ReplyDelete
    Replies
    1. getting above error while installing VBoxLinuxAdditions
      how to know real kernel ?
      when i ran uname -r mine is 4.19.5-1.el7.elrepo.x86_64
      please suggest

      Delete
  4. Thanks Man!! Wonderful blog.. Keep it up!!

    ReplyDelete
  5. Thanks Hegi for the detailed installation steps. I am using hdp3.0 version and internet is not working after installing the GNome. I have tried changing the network adapter settings but no luck. The ip address got changed to 172.*.*.*. Can you please help?

    ReplyDelete
  6. It is not working for me. After the command reboot now my ssh connections break. It come to the windows command prompt I didn't get any desktop

    ReplyDelete
  7. I’m not that much of a internet reader to be honest but your blogs really nice, keep it up! I’ll go ahead and bookmark your website to come back down the road sap training centers in hyderabad

    ReplyDelete