Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality. If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers. And always feel free to hit us up on Twitter @MxdRealityDev.

Emulator and localhost

I am trying to run one of our UWA solutions in the HoloLens emulator. Our app points to a service that is running in another instance of Visual Studio on my machine which is exposed to the UWA app over a localhost and port address.

The HoloLens emulator does not seem to be able to see localhost as it is configured out of the box. To confirm that it wasn't some other issue in our UWA app, I did a simple test and opened the Edge browser in the emulator and typed in the localhost:port address of the service (which also works from a browser). The Edge browser in the emulator threw a "Hmm, we can't reach this page." error, so I suspect that it has to do with the Hyper V VM configuration.

Is it possible to configure the Hyper V and the HoloLens emulator instance so that it can see localhost when debugging these kinds of solutions? If so, are there any simple instructions on how to make the necessary configuration changes?

Thanks.

Windows Holographic User Group Redmond

WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings

Tagged:

Best Answer

Answers

  • Maybe is a stupid comment, But if you ipconfig in cmd, you are able to see different IPs when running Hyper-V.One is for the emulator I think...

  • Hi @HoloSheep ,

    I am facing the same problem now. I try to connect to localhost and it seems with Hololens Emulator it is not possible. I have try with my universal app with other emulator for other device and it works perfectly. Someone point out in other post something similar. Do you have a solution?

  • Hi @DiegoV,

    I did find a blog post that was talking about something similar with HyperV, however I was not successful in using the info in that post to get a 2D UWA app on the HoloLens emulator to connect through localhost to another service app on my pc.

    Ultimately, we had to leverage a cloud relaying feature in our application to work around it, but it would still be helpful to find a way to configure the HoloLens emulator in the VM to work with localhost on the underlying machine for better development and debugging productivity.

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • Hi @HoloSheep
    Yes, I have added a new post with this question here.
    I am doing my tests with another Emulator Windows 10 an it works ok. But indeed when I use gestures or other things in HoloLens it will be a mess to communicate. With real device I think we will not have problems due to is a normal computer ( I guess) maybe somebody from Microsoft can confirm...

  • ChimeraScornChimeraScorn admin
    edited April 2016

    Thank you for reporting this issue. We are investigating this.

  • Dear @ChimeraScorn ,

    Any update?

  • Its all about TCP/IP network routing. Localhost on the HoloLens Emulator is server one network gateway created by Hyper-v namely 172.x.80.1 and your Windows 10 is on another Localhost on gateway , possibly 192exter.pri168.x.1, the default subnet mask is set to split the networks namely 255.255.255.0, therefore you cannot talk to a port 80 webserver on Windows 10, from Windows Holographic emulator. You can talk to the router and Internet without any problems at its subnet mask allows any connection. The Hyper-v network address is fixed, if you manually set new addresses the Hyper-v code will change them back!!!!.

    So in summary its a Hyper-v problems NOT an emulator problem. Hyper-v Manager can only change from internal to private. If you set external you will Hang the Emulator in OS starting.

  • Hi @Jimbohalo10 ,

    So why I can do the same with another Windows Emulator? In my case I am able to connect with TCP with any Windows Emulator(512MB, 1 GB RAM) with the exception of Hololens emulator.

  • @DiegoV said:
    Hi @Jimbohalo10 ,

    So why I can do the same with another Windows Emulator? In my case I amloo able to connect with TCP with any Windows Emulator(512MB, 1 GB RAM) with the exception of Hololens emulator.

    Maybe its the way the Hyper-v is created, but having reconfiguring my network to make this work on for a while I connected two pc with emulators to talk to each other I expect there is some deeper reason in Hyper-v blocking this activity. On a single pc local loopback 127.0.0.1 has been blocked in the emulator and ping responding does not work which is outside scope of this thread

  • @Jimbohalo10 Yes that's it. I have a local network with direction 192.168.0.X. I have my a host in my computer. I have the exception "No IPEndpoints were found for host 192.168.0.16" that its my computers IP. For enable internet in my hololens I used this post With other emulator works perfect with hololens no. As an additional clue I have run in cmd "netstat -a " command. As soon as I start Hololens a lot of services appear there. If you find any clue please let me know.

  • Have you tried using Fiddler2? Not that I've tried this with Hololens yet, but I've got this to work on Windows 10 Mobile, so it could be worth a shot. I use it to monitor and decrypt SSL connections within the emulator and hardware. Since Fiddler2 is running on the host, you should be able to access a program/IIS running on the host using their reverse-proxy feature.

    http://docs.telerik.com/fiddler/configure-fiddler/tasks/monitorwindowsphone7
    http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/UseFiddlerAsReverseProxy

  • Finally I was able to do it with 2 computers, but the latency with emulator is horrible. With the app running in one of the computers goes better. Even with a mobile emulation. Maybe the network is not a "real emulation behavior"

  • Hi @HoloSheep ,
    I have found this interesting note here. As it seems that Hololens communication is based on sockets. I think that this is the problem that we are experiencing.
    Note: As part of network isolation, the system forbids establishing socket connections (Sockets or WinSock) between two UWP apps running on the same machine via either the local loopback address (127.0.0.0) or explicitly specifying the local IP address. This means that you cannot use sockets to communicate between two UWP apps. UWP supplies other mechanisms for communicating between apps. See App-to-app communications for details.

  • This appears to be the new way UWP apps will have to communicate over TCP ControlChannelTrigger Class
    Looking like going back to Networking-Basics
    More overview in the way UWP is taking dev programs Networking

  • Jimbohalo10Jimbohalo10 ✭✭✭
    edited May 2016

    There is a page about this 127.0.0.1 problem in debug for stream sockets at https://msdn.microsoft.com/en-us/library/windows/apps/hh780593
    which describes how to enable loopback using "CheckNetIsolation.exe LoopbackExempt GUID number"

    This is high advanced level coding and network control so may not be for everyone

  • @DiegoV said:
    Hi @HoloSheep ,
    I have found this interesting note here. As it seems that Hololens communication is based on sockets. I think that this is the problem that we are experiencing.
    Note: As part of network isolation, the system forbids establishing socket connections (Sockets or WinSock) between two UWP apps running on the same machine via either the local loopback address (127.0.0.0) or explicitly specifying the local IP address. This means that you cannot use sockets to communicate between two UWP apps. UWP supplies other mechanisms for communicating between apps. See App-to-app communications for details.

    Hi HoloSheep,
    I have a server based on WinSock running on a computer. The client is also based on the Winsock but running on the emulator. I cannot connect to the server from the emulator.
    How to deal with this issue?

    Many thanks.

Sign In or Register to comment.