Multiply network interfaces
Brought to you by:
marha
I have 2 active network cards:
1. phisical - DHCP
2. virtual - static
When try to launch XDMCP I've got error below.
Xserver before connect to remote host should detect automatically what interface to use (as you can connect through both depending on target) because DHCP does require to set "from" every time -
Welcome to the VcXsrv X Server Vendor: The VcXsrv Project Release: 1.17.5.1 OS: Windows NT 6.1 build 7601 (64-bit) Contact: marha@users.sourceforge.net DefineSelf - [myhostname] has 2 usable IPv4 interfaces... addresses [1st_IP] [2nd_IP] DefineSelf - [myhostname] has IPv6 addresses... ::1 (EE) Fatal server error: (EE) Multiple ip-addresses detected: [2nd_IP] [1st_IP] Please specify the ip-address you want to use with -from (EE) (EE) Server terminated with error (1). Closing log file.
You can also specify a hostname with the -from option, it does not have to be the ip-address.
Yes, but no (
First, most of my linux mashines cannot resolve my/other clients' hostnames.
Even I hardcode (very very bad habbit) my PC in /etc/hosts of remote linux - it cannot show me xdm.
Only when I specify exect IP with the -from option everithing works ok.
xming do not have this issue, but I would prefer to use more modern tool )
Not sure if this is of use to too many folks. I wrote my own solution to this problem. I use xdmcp over a vpn that uses dhcp, and, like Roman found that vcxsrv balks because it finds two working ipv4 interfaces. It is very impractical to manually change the ip in either a shortcut or by rerunning xlaunch.
Mostly out of curiosity about powershell, I implemented this as a powershell script. In the end I downloaded PS2EXE from the microsoft technet site, renamed the vcxsrcv executable and put this in as vcxsrve.exe to act as an intermediary. That way you can continue using XLaunch and existing shortcuts, or just make a new shortcut with the parameters you want,
What it does is to check if this is an xdmcp session (i.e. -query is in the command line), and check if there is a -from in the command line. if -query but not -from, it adds -from with the active ipv4 interface with the lowest metric, since when windows is managing routing it always sets the lowest metric on the current default gateway. If -from is specified but is not an ip, the script looks for an interface with that name. Windows names vpn interfaces with the name you gave them, but in any case, just use the names as they appear in the control panel network interfaces page. So "-from myvpnname" or "-from wi-fi" or "-from 'ethernet 3' (not case sensitive). To the extent of my .. imagination.. this gives a solution to almost every case.
So, if anyone, particularly the author, is interested, I'm happy to post the script here or wherever you want.
Oh, out of pure silliness I called it xdinner because it comes after xlaunch ... bad-dum-pum.
Marc Saint,
Yes, I'm interested to try your script. Please share it any suitable way.
May be the algorithm will be incorporated in VcXsrv later )
Thank you in advance
Here it is. You'll want to paste it into an editor where it won't wrap.
Sorry for the excessive commenting. I have a terrible memory. In a couple of weeks, it might as well be someone else's code ... but that someone commented it so thoroughly!
Last edit: Mar Saint 2016-02-27
One other thing worth mentioning: you can rename interfaces in network connections settings section of the control panel (you can access this by clicking "Change Adapter Settings" on the left side of the Network and Sharing Center in Win8/10). The name you change it to will be the one you can use with this script.
I totally and wholeheartedly support this feature request. The algorithm used in Mar Saint's script is probably most often what is wanted, though on a truly multi-homed host, it would probably be better to specify that the code should bind to a specific adapter (whose IP may change if using DHCP).
Choosing the lowest metric adapter would work for all my desktop machines though on one or two servers the ability to specify the adapter to use would be better (but in those cases I can use "from" as their IPs are more normally fixed.
Here's my current set of adapters on my laptop (ignoring the tunnel adapters) which confused VcXsrv as it chose the VMNet8 adapter to bind to instead of the adapter called "Ethernet" with the result that my Unix box tried to connect back to 192.168.239.1 rather than 192.168.129.83 until I used -from. However if I undock I'll want to use the Wireless port instead of the wired one ...
Windows IP Configuration
Host Name . . . . . . . . . . . . : APOLLO
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : home
Wireless LAN adapter WiFi:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : home
Description . . . . . . . . . . . : Broadcom 802.11ac Network Adapter
Physical Address. . . . . . . . . : B8-EE-65-58-5C-AD
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Wireless LAN adapter Local Area Connection* 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter
Physical Address. . . . . . . . . : BA-EE-65-58-5C-AD
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : home
Description . . . . . . . . . . . : Intel(R) Ethernet Connection I217-LM
Physical Address. . . . . . . . . : EC-F4-BB-56-57-A3
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::1076:c222:65aa:77f4%13(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.129.83(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : 16 March 2016 21:15:17
Lease Expires . . . . . . . . . . : 02 April 2016 14:25:01
Default Gateway . . . . . . . . . : 192.168.129.254
DHCP Server . . . . . . . . . . . : 192.168.129.254
DHCPv6 IAID . . . . . . . . . . . : 283964603
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1E-1D-9C-69-B8-EE-65-58-5C-AD
DNS Servers . . . . . . . . . . . : 192.168.129.254
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::d421:2f47:1909:b763%15(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.154.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 167792726
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1E-1D-9C-69-B8-EE-65-58-5C-AD
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter VMware Network Adapter VMnet8:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
Physical Address. . . . . . . . . : 00-50-56-C0-00-08
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::54cf:abbc:c8f9:ff97%6(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.239.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 385896534
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1E-1D-9C-69-B8-EE-65-58-5C-AD
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
Dave
I cannot reproduce this error on latest version.
Was issue fixed?
Or somth wrong with my computer... )
Indeed, in the latest version this is not a fatal error anymore, but only a warning message is printed in the log file.