Network Printer static IP

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Docfxit
Posts: 129
Joined: 23. May 2014, 12:35
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: XP Pro, Win7, Win10

Network Printer static IP

Post by Docfxit »

I need to add a Networked printer with a static IP address of 192.168.168.27
My Host is Windows 10 with a gateway of 192.168.168.168 the DNS should be 8.8.8.8 8.8.4.4
I need to add the printer drivers into Vbox ver.7.0.6
My understanding is in order to add the drivers for a printer the Vbox has to be on the same network.
With the Vbox shutdown I tried setting the network with this .bat file:

Code: Select all

C:\Programs\VirtualBox\VBoxManage.exe natnetwork modify -t intnet -n "192.168.168.0/24" -e --ipv6 off
After starting the Vbox from within the Vbox this is what it looks like:

Code: Select all

C:\Users\Gary>ipconfig /all
Windows IP Configuration
   Host Name . . . . . . . . . . . . : Win10Vbox
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Ethernet:
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Desktop Adapter
   Physical Address. . . . . . . . . : 08-00-27-70-A8-0A
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::650d:1a49:8b37:40e5%12(Preferred)
   Autoconfiguration IPv4 Address. . : 169.254.64.229(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 101187623
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-24-3D-CB-8F-08-00-27-70-A8-0A
   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled
This is what the settings for Network are:
VboxNetwork.jpg
How can I change the Vbox network to be 192.168.168.24
BillG
Volunteer
Posts: 5100
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Network Printer static IP

Post by BillG »

IP addresses are important, but the most important thing is that the vm and the printer need to be in the same network so that they can communicate.

Your vm appears to be in an internal network. Do you have a router between this internal network and the network where the printer is? The internal network and the physical network cannot use the same IP subnet, so the vm cannot have an IP address in the 192.168.168.0 subnet. It will need an IP address matching any other vms in that internal network, and you will need to route traffic between that network and the physical network where the printer and the host are. This will not be easy if the host and the printer have a default gateway pointing out to the Internet.
Bill
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Network Printer static IP

Post by scottgus1 »

You should use Bridged. See Virtualbox Networks: In Pictures: Bridged Adapter

Internal doesn't connect outside of the VMs connected to it, so the VM on internal cannot connect to the printer without lots of custom work, as Bill points out above.

NAT and NAT Network are "routers" between the VM and the host's network. So there would be some extra work to do in those setups too. And setting the VM side of NAT or NAT Network to the same IP range as the physical host network would be a wrong configuration. The two sides of the router, either physical or virtual, are supposed to be different IP ranges.

Use Bridged. Let the VM get its IP address settings from DHCP. They'll come from the physical host network's router. Then the VM should be able to see the printer.
Docfxit
Posts: 129
Joined: 23. May 2014, 12:35
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: XP Pro, Win7, Win10

Re: Network Printer static IP

Post by Docfxit »

Thank you for the suggestions...

My LAN and the printer are both behind the same router.
My Router Gateway is 192.168.168.168
I have IPv6 turned off on my router & my Host

I changed the Network to Bridged
Vbox is now showing:

Code: Select all

Windows IP Configuration
   Host Name . . . . . . . . . . . . : Win10Vbox
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Ethernet:
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Desktop Adapter
   Physical Address. . . . . . . . . : 08-00-27-70-A8-0A
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::650d:1a49:8b37:40e5%12(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.168.24(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Friday, March 24, 2023 8:55:09 AM
   Lease Expires . . . . . . . . . . : Saturday, March 25, 2023 8:55:10 AM
   Default Gateway . . . . . . . . . : 192.168.168.168
   DHCP Server . . . . . . . . . . . : 192.168.168.168
   DHCPv6 IAID . . . . . . . . . . . : 101187623
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-24-3D-CB-8F-08-00-27-70-A8-0A
   DNS Servers . . . . . . . . . . . : 8.8.8.8
                                       66.51.205.100
                                       4.2.2.3
   NetBIOS over Tcpip. . . . . . . . : Enabled
I should easily be able to install the printer now.

I'd like to find out how to turn off IPv6. It has caused me problems in the past. Vbox help says it will automatically turn it off if the host has it off. My host Windows 10 does have it off.

The DNS server 66.51.205.100 should not be there. It is invalid. I don't know where it's getting it from. How can I turn it off?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Network Printer static IP

Post by scottgus1 »

Since the VM is Bridged and receiving DHCP-served IP data, I'd suspect the physical network router or something else out on the internet, like the ISP, providing the odd DNS IP address or the IPv6.

Bridged takes everything IP-related from the LAN, not Virtualbox settings.
Docfxit
Posts: 129
Joined: 23. May 2014, 12:35
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: XP Pro, Win7, Win10

Re: Network Printer static IP

Post by Docfxit »

Thank you very much...

Have a great day!
Post Reply