One of my friends recently asked me if it was possible to run a GUI application in ubuntu without installing a desktop environment. He had a machine at work which functions as their server. Therefore, there isn't any DM or DE installed on it. He wanted to run a browser on it without installing a DE which will clutter things up. While one solution is to install a lightweight desktop environment like xfce or lxde, I decided to figure out a solution which will work without any. I will be posting my solution below because I could not find anything that would work online and I feel that this could help others facing this problem. Feel free to make any suggestions or to suggest alternative solutions.
*My solution works with Firefox but not with Chrome. The details are down below. If someone figures it out please do leave a comment.