Run browser on VM and View Display on Mac

Spread the love

Problem:

I want to use the VM to run the edge browser but wanted to stream the display on my mac machine. This way I will be using the mac for viewing purposes only.

The setup instructions mentioned below are using 1980s technology. So, it will not much performant. But if you are using remote server with ping less than 10ms then it will be usable.

For better option I will suggest using any type of VNC setup. The LinuxServer.io webtop docker container is ideal for running a full desktop on VPS. Use the ubuntu with xcfe desktop environment. Then to securely access the container, use the SSH tunnel port forwarding. It will make the remote server forwarded port services in local machine. And you can connect to the running service on that port using localhost.

Let’s get started 🙂

So, for that I had to install X11 server (XQuartz) on mac.

On remote machine I was running ubuntu. So insalled x11-apps

apt install x11-apps

Make sure that X11 forwarding is enabled on remote machine

cat /etc/ssh/sshd_config | grep -i X11Forwarding

It should display

If not then edit the config file and uncomment or add the above line.

Start the XQuartz locally.

Connect to remote server using ssh using terminal

ssh -v -X -C root@myip

Use the key or password to authenticate.

Install helper libs:

sudo apt install software-properties-common apt-transport-https curl ca-certificates -y

Add GPG key

wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -

Using the above command may give you warning for apt-key deprecated. In that case you can use keyrings. Search the net 🙂

Add Repo

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'

Update package list

sudo apt update

Install the edge

sudo apt install microsoft-edge-stable

Check version

 microsoft-edge --version

Launch

export DISPLAY=:10.0 && microsoft-edge --no-sandbox

The below command should show the connected display to your remote computer. In the above command 10.0 is the connected display identifier.

echo $DISPLAY

For better performance, you can use x2go.

Install the server on remote machine. Install client on local machine. When configuring the session, select single application and add the command ‘microsoft-edge –no-sandbox’

Cheers and Peace out!!!