How to use static IP with host-only networking?

Discussions about using Windows guests in VirtualBox.
Post Reply
timtimtim
Posts: 25
Joined: 12. Nov 2010, 19:13
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows7

How to use static IP with host-only networking?

Post by timtimtim »

Is this possible? I can get host-only networking (HON) working using DHCP on the host and guest, but when I change both to static IP (192.168.0.nnn), and reboot the guest this breaks HON. Is there a trick to HON and static IP?
VBox : 7.0.10
Host: Manjaro Linux
Guest : Windows 7
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to use static IP with host-only networking?

Post by Perryg »

You would need to make sure that the guest and the host are in the proper network scheme. Look in the main VBox program under file -> preference -> networking and see what the defined scheme is. If you need it to be different you can change it from there. Make sure it is not in the same scheme that you local network is or you will have more problems.
timtimtim
Posts: 25
Joined: 12. Nov 2010, 19:13
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows7

Re: How to use static IP with host-only networking?

Post by timtimtim »

Thanks, Perry
file -> preference -> networking, I never would have guessed!But at least I have static IP with HON. Now for some speed tests with bridged/host-only and virtio-net/intel pro mt combinations.
VBox : 7.0.10
Host: Manjaro Linux
Guest : Windows 7
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: How to use static IP with host-only networking?

Post by BillG »

Or, since you have a Windows host, you could install a Microsoft Loopback Adapter in the host OS and use that to host your connection to the guest(s).
Bill
timtimtim
Posts: 25
Joined: 12. Nov 2010, 19:13
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: windows7

Re: How to use static IP with host-only networking?

Post by timtimtim »

Thanks for the tip, Bill. I installed it but didn't use the Loopback Adapter as the quoted network speed was 10Mbs-1 and there wasn't an (obvious) way to change it.

Now for some results:

(virtio-net) bridged = 40 secs
(intel pro/mts) bridged = 36 secs
(intel pro/mts) host-only = 43 secs
(virtio-net) host-only = 42 secs

Test = Scripted creation of 400 shortcuts to PDFs (113) and source code files (287). Thus 400 commands referencing \\hostname in the command-line.

(virtio-net) bridged 44 secs
(intel pro/mts) bridged 35 secs
(intel pro/mts) host-only 38 secs
(virtio-net) host-only 46 secs

Test = Mirror of user folder on host share to ramdisk on guest (62MB, 8190 files).

However, in a typical operational scenario (opening and scrolling PDFs, editing code, diagramming in powerpoint) there just doesn't seem to be any difference between the 4 options.
VBox : 7.0.10
Host: Manjaro Linux
Guest : Windows 7
Post Reply