Author Topic: Virtualbox, NAT and using ICAT  (Read 824 times)

Lars

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 51
  • Posts: 552
    • View Profile
Virtualbox, NAT and using ICAT
« on: April 20, 2020, 08:54:02 pm »
Hallo,

I have OS/2 running as a guest under Virtualbox on a Win 10 machine. Within that virtual machine I want to run ICAT in UDP mode.
Then I have a MUT which is running native OS/2 with the debug kernel.
The 2 machines are connected to my router, both use WIFI. The router has IP address 192.168.178.1.

1) the MUT has a statically assigned IP address of 192.168.178.120.
2) the MUT needs to run KDBNET.SYS t so that you can connect via UDP and KDBNET.SYS needs to know the MUTs IP address and a netmask. I have set up IP address 192.168.178.120 and netmask 255.255.255.0.
3) the OS/2 guest is using DHCP. In the past I had also configured with a static IP address in the 192.168.178.x range but occasionally I want to connect to another WIFI access point than my home network in which case this approach will fail (at least I don't know how to make that work).
4) ICAT (executing in the OS/2 guest) requires a target IP address (of the MUT) and a port for correct operation. In the past, I had been using "bridged networking" for the OS/2 guest and I specified 192.168.178.120 as the IP address and port 1000 (the default) which worked fine. Note that port 1001 is also used for the KBDNET connection.

Bridged networking works very unreliably with a WIFI connection and often fails in requesting an IP address via DHCP. Therefore I switched to NAT.
The OS/2 guest now has good network connectivity, but the IP address of my OS/2 guest now is in the range of 10.0.2.x. That results in ICAT failing to connect to the MUT.
What do I have to set up where in order for the connection to succeed ? Do I need to specify some port forwarding for the NAT and if yes which one ?
Or do I need to specify some routes ? If yes, where, in the OS/2 guest or in the MUT ?


Lars
« Last Edit: May 07, 2020, 09:10:30 am by Lars »

Andi B.

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 22
  • Posts: 487
    • View Profile
Re: Virtualbox, NAT and using ICAT
« Reply #1 on: April 21, 2020, 11:02:39 am »
Sorry I don't know much about VBOX networking. But in your setup question comes to mind why don't you use 2 network adapters for your guest? One specifically for ICAT with fixed IP f.i. 192.168.178.129 and another one with DHCP if you like.

I guess your router is a xDSL router and both machines are connected to the switch which is integrated in the router, correct?

In setup.cmd I would suggest something like
...
ifconfig lan1 192.168.178.129 ....
..
..
ipgate off
call mode 100,75 & dhclient lan0

Don't use the DHCP client which comes with OS/2 but the .rpm one.

Is there a specific reason why you don't want to separate these to networks?

I know the network part of our VBOX running on OS/2 is crippled. But guess VBOX running on Win will work much better.


Andi B.

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 22
  • Posts: 487
    • View Profile
Re: Virtualbox, NAT and using ICAT
« Reply #2 on: April 21, 2020, 11:17:07 am »
Thinking more about, I'm not really sure anymore if this works with wifi. Would have to test. At least it should work if you setup your 'standard networking' in a different subnet than the ICAT network while the access point covers both subnets.


Lars

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 51
  • Posts: 552
    • View Profile
Re: Virtualbox, NAT and using ICAT
« Reply #3 on: April 21, 2020, 04:07:20 pm »
My win10 machine is a laptop. There is no good way to have a second MAC as I cannot connect to my router via cable. I also do not want to spend any extra money. A Virtual machine should be able to use the one and only host MAC interface.
I have the impression this is all a WiFi specific problem. And this problem affects the proper op. of bridged networking.
That would be the most forward to set up.

Valery Sedletski

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 25
  • Posts: 356
    • View Profile
Re: Virtualbox, NAT and using ICAT
« Reply #4 on: May 05, 2020, 11:39:07 pm »
2Lars: Why do you try to debug OS/2 with ICAT and did not try usual debugging via a COM port and standard kernel debugger? It's easier to setup, and
I debug my drivers and IFS'es this way. It's possible to use standard terminal emulator like Putty in Windows, Minicom in Linux and DTerm in OS/2. These
terminal emulators support using a named pipe or a local socket instead of a usual COM port. And VirtualBox (including the OS/2 port of it) supports redirecting
a VM COM port to a host pipe/socket. I wrote (an unfinished) document about debugging of OS/2 drivers in VBox (and not only). It is included into my VBox
additions distribution (docs\debug.txt in the Additions ISO). If you have more questions, you can ask me here.

PS: For ICAT, you can do a portmapping with NAT in VirtualBox. It should be not very hard. Yes, TAP/TUN option may not work with some wifi
cards (though, it works fine with mine). But NAT option does not depend on it.
« Last Edit: May 05, 2020, 11:43:43 pm by Valery Sedletski »

Valery Sedletski

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 25
  • Posts: 356
    • View Profile
Re: Virtualbox, NAT and using ICAT
« Reply #5 on: May 05, 2020, 11:47:58 pm »
Ah, so you need to run ICAT in a VirtualBox VM, not a MUT in VirtualBox. Sorry, didn't understood the question for the first time.

Lars

  • Hero Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 51
  • Posts: 552
    • View Profile
Re: Virtualbox, NAT and using ICAT
« Reply #6 on: May 07, 2020, 09:07:51 am »
In the meantime I presumably fixed the problem. I found a hint in the internet that I need to turn on  "automatic IP address assignment" (DHCP) and also "automatic DNS address assignment" in the "VirtualBox Host adapter" (in Win 10).

I have no clue why that fixes my problem but it does (at least the situation has substantially improved).
« Last Edit: May 07, 2020, 09:22:26 am by Lars »