Looking Glass - Triage

I’ve been taking a break from my passthrough image for a bit, testing DXVK. (which is looking promising on 18.04 LTS)

Give me a week or so before I go back to my FC27 passthrough and Looking Glass image. Things have been rough with me and other Twitch streams these past couple of days.

No worries mate, I am more then happy to support what you’re trying to do the best I am capable of, just give me a ping when you get a chance.

that’d be interesting, at that scope you’d essentially be re-implementing a feature of syphon

Hi,

I’m trying to find a guide for cmake, cause it’s complaning about missing libs/modules. Do you have a simpel walk-by guide?

I did try both with, and without cmake :slight_smile:

➜  client git:(master) ✗ sudo cmake .
-- Checking for modules 'sdl2;SDL2_ttf;gl;glu;spice-protocol;fontconfig;x11;libconfig;nettle;hogweed'
--   No package 'nettle' found
--   No package 'hogweed' found
CMake Error at /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:415 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal)
  CMakeLists.txt:10 (pkg_check_modules)


-- Configuring incomplete, errors occurred!

I’m going with the git-build, cause of your comment:

Install libnettle-dev… And why use sudo to cmake? Thats just plain dangerous.

Fair :slight_smile: I just tried a few things, and ended up give sudo a try. The first tries was without :slight_smile: The libnettle-dev did the trick.

I typed a few things about my steps here, is anyone can use it. But i currently have problems with blank screen.


Maybe this is a dumb question to ask, but do i need a dedicated monitor for this to work?

My guide, at the moment:

Virt-manager (With Looking Glass) on Linux Mint 19 - July 24, 2018

Virt-manager (With Looking Glass) on Linux Mint 19

Virt-manager and other packages

Use this guide. But, here is a few things you need to install (Tested with Linux Mint 19)

sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager qemu-img firewalld ebtables dnsmasq qemu-utils gir1.2-spiceclientgtk-3.0 cmake git

You don’t have access to run virsh before the user is added so do this:

sudo addgroup libvirtd
sudo adduser exetico libvirtd
sudo adduser exetico kvm

Now check with: sudo virsh -c qemu:///system list

Virtual manager is started with virt-manager but you should also be able to launch by searching for Virtual Machine or something simular. It any errors shows up, reboot the system before taking the next steps.

If everything goes fine, now create the VM, install whatever OS you like, and go to the next step.

Looking Glass installation

Use this page for more details.

You need to compile the system-files with cmake.

Compile from GitHub

Clone the repo with:

git clone https://github.com/gnif/LookingGlass

Now navigate to the client-folder:

cd LookingGlass/client

Now run the following commands, one by one:

cmake
make

If you run ls you’ll find a new file called looking-glass-client. That’s our best friend from now on, but let’s get libvirt ready (Yep, not QEMU here…)

Get libvirt ready

Let’s set libvirt ready. You can find a few more details on the webpage.

Let’s open up the config for our VM. Note that my VM is called “win7”.

 virsh edit win7

Add the part with:

<shmem name='looking-glass'>
  <model type='ivshmem-plain'/>
  <size unit='M'>32</size>
</shmem>

That part should be inside the <devices>part. Mine is added as the third last line, just above </devices></domain>.

Please pay attention to the memory size. 32 matches up to 1080p, so i’lll tray with that at the moment (If you don’t get this like, check out the webpage please)

touch /dev/shm/looking-glass
chown user:kvm /dev/shm/looking-glass
chmod 660 /dev/shm/looking-glass

I personally edited the group-settings in the virtd-config to kvmbut i don’t think that it matters…

Guest RAM issues

If you have issues with permissions to access “guest RAM”, please use appamor, and add the following to (I’ve also installed sudo apt install apparmor-profiles, but i don’t think it’s needed)

sudo nano /etc/apparmor.d/abstractions/libvirt-qemu 

Put in this, in the bottom of the file:

/{dev,run}/shm rw,
/{dev,run}/shm/* rw,

Reload the rule if needed.

If you forget the / you could see issues with kvm-spice.

Please keep in mind that i don’t have that much knowledge about apparmor… :slight_smile:

File locations

QEMU config: sudo nano /etc/libvirt/qemu.conf
LIB virtd config: sudo nano /etc/libvirt/libvirtd.conf

Q’n’A

**Q: **Virtlib aren’t avalible?
A: Check if it’s running with ps faux | grep libvirt-bin - If virtlib isn’t started after reboot, try: service libvirt-bin start (without sudo). If you made something bad with the config, check the status with: service libvirt-bin status

Q: I’ve problems with Guest RAM-things.
A: Check the details about “Guest RAM issues”, and search both here - and on other sites, if you like. Normally it’s just a permissions-issue.

  1. Logs show spice communication problems, this needs to be fixed.
  2. Logs show the host never signals it’s ready
  3. Your apparmor profile is dangerous, it should target the specific file, not all files in shm.

Is /dev/shm/looking-glass correct for your system? You created the file and set it’s ownership, etc… but is it actually in use by qemu?

Did you start the host application on the guest?
Does the guest have a display attached to the video card?
Does A11 work?

I did not inform everyone to try the latest bleeding edge version, only @FurryJackman as I am aware of his setup and his level of ability. If you can not diagnose these issues yourself DO NOT run the latest bleeding edge version! And furthermore, do NOT provide guides to use it… Your guide can be outdated by a single change on my part leaving everyone confused and lost.

Hi again,

Thanks! I’ll look into it, after i have a Win10 image with me. I’m currenly on a mobile-location :slight_smile: I just saw that W7 won’t make it.


:smiley:

Correct, Windows 7 does not have DXGI Capture, even if the IVSHMEM driver is built for it, it is still useless.

1 Like

Xubuntu 18.04 (vanilla 4.17.8 + tr.patch) LG bleeding edge (client/host) looks working.

Maybe lower FPS performace? If I compare with Looking Glasses results.

The “host” application or server if you wanna stay in a “server-client-model” just grabs the frames and puts them in the shared memory, it is where the frames are produced. The use-case is that the frames are produced in a VM and need to be “played back” on the virtualization host in cases when for example you can’t spare a dedicated monitor for your VM plugged in into its GPU.

So, this isn’t something that can be used over a “real” network, but only the virtual network between the VM and host of VM due to the program using a shared RAM allocation on the physical system?

What do you mean by that? The games are still run in the VM and you could play most games in there and display them via LG on the host. It certainly does have more or less overhead depending on the hosts hardware setup but there are also certain games, especially multiplayer, that forbid being played in a VM for anti-botting protection.

This program seems like the perfect solution (outside of Windows-level support for video games) to allow Linux users to play whatever video game they want, so I was wondering why it isn’t currently being used for this purpose (unless it is?).

To add some context, I only found out about Looking Glass a few days ago, which is about a week after I had attempted (and discovered the futility of) using RDP to play PC games running on a Windows 10 machine from an Arch Linux machine. This program seems like the EXACT thing I am looking for (albeit I would prefer not needing the overhead of a VM and just have it over a network, or even just a cable between two NICs).

Correct, it is a local segment of shared memory, which is how we achieve such low latency with zero compression.

It is :slight_smile: but Looking Glass is still under heavy development, as such results may vary.

Guessing from Linus Tech Tips, I am still amazed that my little side project has had so much attention from the public.

Note that you still need to pass through a physical GPU to the Guest OS, if you can do this then Looking Glass will certainly fit your requirements.

I notice you’re using the nouveau driver. The stream reports it is getting 59FPS, but only rendering it on the client at 49.2FPS, so the stream is coming through fast enough but the client is not keeping up. Are you able to test using NVidia’s proprietary drivers?

With nvidia driver performance looks OK.

Screenshot

https://www.monitos.cz/tmp/LG_bleeding_edge_20180724_nvidia.png

Looks like LG_be still working in Win8.1. My EIZO CG211 has probably broken gravity sensor, must be used in portrait mode. :wink:

Screenshot with [email protected] too (HostOS making screenshot slowdown FPS from 60 to 20)

https://www.monitos.cz/tmp/LG_bleeding_edge_20180724_nvidia_w81.png

Great work. I just watched Linus’ video and come here to see what this project is about.
To me, it looks a lot like Parsec but no network/WAN streaming. I am looking for an alternative to Parsec and this feels like can be an alternative if we could access it over the network. I do not prefer using Parsec because it is not open source and it needs to sign in to their server. I am aware of the open source tax that comes with OSS.
So the questions are: can this be done like Parsec (over the network) with using other OSS together? Does it work with AWS Gx instances? Thanks in advance!

P.S. One interesting question: Windows has a WSL loaded for every W10 after the Fall Creator Update, can this be used to run LG?

If this is what you are looking for, then this is not the project for you. LG works on a completely different level.
There is no encoding involved, it literally copies the frames from the VM to the Host and does nothing else with it.

Theoretically any software can hook into the shared memory and do whatever with it, but at that point it becomes a question of why have a shared memory in the first place and not just straight encode. Steam can do the same thing (in Home Streaming, Linus did videos on that too), but of course it’s also not open source.
It could be done with OBS (probably), but it would be a homebrew solution (stream to a custom RTMP Server and have only mouse/keyboard be sent to the rendering machine).
Anyway, not really what LG is doing.

Yea, I figure that may not be a good scenario for using LG. Things are cool when using parsec except it is not OSS. I will try other solutions as an alternative. Thanks.

Newtek’s NDI protocol is gaining popularity on the networked “dual system” setup front. However, it is limited to 30fps. LG can go up to 4K 300FPS theoretical on a X299 system running a 7900X in quad channel DDR4.

Do hit the forum if you find something that fits :wink:

I googled around a little but I couldn’t really find any alternatives. All I could find were articles about various cloud gaming solutions which is not what InHome Streaming is at all :frowning:

I think there’s still some way to go until it hits that, but to be honest it’s working amazingly well from what I read, considering it’s such an early stage.

Where do I put this?

<shmem name='looking-glass'>
  <model type='ivshmem-plain'/>
  <size unit='M'>32</size>
</shmem>

silly question, but it has been a while since I got Looking Glass working and now after system reinstall I’m starting from scratch and as I have limited experience editing VMs outside GUI manager I have no clue in which section I should add it while using virsh edit.