A TLDR is available, that only includes the basic steps needed for virtual displays to work. For slightly more in-depth explanations, continue reading from the next section.
First attempt #
- Connect the nreal air to the computer via USB-C cable;
- Nothing happens :(
Initial setup for the nreal air #
Activation #
Nreal glasses cannot be used out of the box before being activated first. Activation can be done either with a PC or a device compatible with the nebula app.
With a PC #
- Connect the nreal air to a computer via USB-C cable;
- Activate the glasses by following the instructions in https://activation.nreal.ai/en/nreal-air-upgrade.html;
- Done!
With the nebula app #
- Using a smartphone from the compatibility list* or a compatible computer (like the MacBook M series);
- Using a smartphone:
- Install the Nebula app:
- Android 12 support is dodgy. If the next steps do not work, try to either downgrade to Android 11 or download nebula version 2.3.4 (I won't link it here since I couldn't find an official source, you'll have to find it on your own cough apksos.com cough);
- Install the Nebula app:
- Using a compatible computer:
- Install the Nebula app. You'll have to search online for the installation instructions;
- Using a smartphone:
- Connect the nreal air to your device via USB-C cable;
- Wait for you the glasses to be picked up by the app;
- Follow the onscreen instructions to activate the glasses;
- Done!
* There are smartphones outside the compatibility list that work. From what I could gather, the basic requirements are:
- Android 11 or newer (android 12 might only work with older versions of nebula);
- USB-C port with DisplayPort alt mode;
- And a snapdragon 800-something newer.
Virtual monitor #
When connecting the glasses directly to a computer, they simply act as a static monitor fixed to the center of your view. The nreal air has 3DoF, which should allow us to fix the monitor in 3D space, giving us the ability to move our head around while the monitor stays in its fixed point in space instead of following our head's movement.
As of the time of writing, 3DoF is only available in MR space with the nebula app either using a compatible android phone or using a Mac M series.
With a PC and a compatible smartphone #
The idea is to create a new virtual display on a machine (either with a dummy plug or with xrandr) and screen share the new virtual display to the nebula app in MR space.
To share the display, we'll use deskreen. Deskreen captures the display and makes it available for viewing in a web browser. The web browser can be accessed from the nebula app in MR space and can be placed anywhere under the constraints of 3DoF.
- Have both a smartphone from the compatibility list and a computer connected and accessible on the same network;
- Install deskreen on your computer:
- Arch Linux:
yay -S deskreen
; - Others: https://deskreen.com/lang-en#page-top.
- Arch Linux:
- Open deskreen on your computer;
- Open the nebula app on your smartphone and launch MR space;
- Copy the link displayed in the deskreen app from your computer and past it into the MR space web browser;
- You'll notice that the page fails to load, showing an SSL-related error.
It seems that the way the nebula app was done, it automatically transforms all http
links to https
. Although the way deskreen works seems secure, nebula webview wants to follow the https
standard. The original maintainer of deskreen does not want to implement https, so we'll have to find a way to expose the deskreen server running locally through https while the service itself is being served through http (or we could fork the project and implement https ourselves, but that would require some extra steps to generating and installing certificates).
To expose the deskreen server through https, we'll use ngrok. There are many alternatives to ngrok, but I'll be using it because it's the one I'm most familiar with.
Using ngrok (or another tunneling service) also lifts the restriction of having both the computer and the smartphone connected to the same network. Although you'll still have to find a way to use inputs remotely, like a mouse and keyboard (but that's outside the scope of this post).
- Install ngrok:
- Arch Linux:
yay -S ngrok
; - Others: https://ngrok.com/download.
- Arch Linux:
- If deskreen is not already running on your computer, open it;
- Open a terminal and run
ngrok http 3131
(3131
is the default port for deskreen, change it if needed); - Copy the https link that is shown in the terminal;
- Open the copied link in the nebula app in MR space;
- After a few seconds, the page should show an error.
The root cause of this error is the usage of hard-coded values for the port
in deskreen. There is a pull request open to fix this, but until it's merged, we'll have to use the fork with the fix:
- Uninstall deskreen;
- Clone this fork of deskreen locally;
- Install all the required packages:
- Inside the cloned repo, run
yarn install && cd app/client && yarn install && cd ../..
; - If there is an error due to a missing command, make sure you have all the build tools installed (
yarn
andnodejs
, possiblynpm
too).
- Inside the cloned repo, run
- Run deskreen:
yarn start
;
Once deskreen is running, repeat the steps from the previous section:
- Copy the https link that is shown in the ngrok terminal;
- Open the copied link in the nebula app in MR space;
- On your computer, the deskreen app should now show a new device requesting access. Follow the onscreen instructions to allow access to one of your existing monitors or a specific app;
- Done!
You should now have one of your existing displays or a specific app being shared in MR space. But we want to have a new display, not an existing one.
To do this, you can either use a dummy display plug or use xrandr to create a new virtual display.
With a dummy display plug (untested) #
- Get a dummy display plug;
- Plug it into your computer;
- Configure the new display to have 1920x1080 resolution (same as the nreal air);
- When connecting to deskreen from the nebula app, in deskreen, select the new display as the one to share;
- Done!
With xrandr #
- In your computer, make sure you have a
VIRTUAL1
display by runningxrandr --query | grep VIRTUAL
;- If something pops up, continue with the next step;
- If not, search online on how to create a virtual display, it might be tricky if you are using nvidia. Good luck.
- The existing virtual display should show up with no resolution and it should display as disconnected. For example, this is my output from
xrandr --query | grep VIRTUAL
:VIRTUAL1 disconnected (normal left inverted right x axis y axis)
- To connect the display, set a resolution to the virtual display by running the following:
1xrandr --newmode 1920x1080_60.00 $(cvt 1920 1080 60 | grep Modeline | sed 's/^Modeline \".*\"\s*//g') 2xrandr --addmode VIRTUAL1 1920x1080_60.00
- And place the virtual display wherever you want. For example, placing it to the left of the main display (in my case
eDP1
):
1xrandr --output VIRTUAL1 --mode 1920x1080_60.00 --left-of eDP1
- When connecting to deskreen from the nebula app, in deskreen, select the new virtual display as the one to share;
- Done!
On my machine using intel iGPU, VIRTUAL displays are automatically added when assigning a mode. Meaning that multiple VIRTUAL displays can be created by running the same commands multiple times changing VIRTUAL1
to VIRTUAL2
/VIRTUAL3
/VIRTUALn
according to the result from xrandr --query
.
TLDR #
Initial setup #
- Make sure your glasses have been activated;
- Install ngrok:
- Arch Linux:
yay -S ngrok
; - Others: https://ngrok.com/download.
- Arch Linux:
- Install deskreen:
- Clone this fork of deskreen locally;
- Install all the required packages:
- Inside the cloned repo, run
yarn install && cd app/client && yarn install
; - If there is an error due to a missing command, make sure you have all the build tools installed (
yarn
andnodejs
, possiblynpm
too).
- Inside the cloned repo, run
- Run deskreen:
yarn start
;
Connecting the glasses to the virtual display #
- Create a virtual display using a dummy plug or with xrandr;
- Open a terminal and run
ngrok http 3131
(3131
is the default port for deskreen, change it if needed); - Copy the https link that is shown in the terminal;
- Open the copied link in the nebula app in MR space;
- In your computer, the deskreen app should now show a new device requesting access, follow the onscreen instructions to allow access to one of your existing monitors or a specific app;
- Done!
Future work #
- Create a script that automates all the steps above.
Caveats #
- Although you can see a new monitor through your glasses, any other input/output like keyboard and sound is not transmitted to the glasses. You'll either have to have access to those IOs locally or find a way to use them remotely;
- Your deskreen server is now being exposed to the entire internet, although you have to approve each connection, it can still impose a security risk;
- Since the screen share needs to go through the ngrok server, there is some latency between typing on the keyboard and seeing the changes reflected on the casted displays. It's not too bad for me, but it might be a problem for some;
- Sometimes when connecting, an error will pop up on the nebula tab about webRTC. I still don't understand in which circumstances this happens, but it fixes itself after a while. Just keep retrying waiting a few minutes between each attempt;
- Your phone needs to be constantly connected to the glasses, which can cause the battery to discharge quite fast;
- Using a dummy display only allows you to have as many displays as you have physical ports (unless a USB-C plug can simulate daisy chaining). Using xrandr allows you to have as many displays as you want.