SOLVED:vm ignores network port settings

Discussions related to using VirtualBox on Linux hosts.
Post Reply
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

SOLVED:vm ignores network port settings

Post by neuronetv »

I have a sun server with four network ports and I imported a vm that was made on another sun server (same machine). Problem is the vm was originally built with static ip's on each port but after being imported to another server the ip's are all stuck as dhcp. I ran the commands:

Code: Select all

VBoxManage modifyvm "linux-server" --nic1 bridged --bridgeadapter1 eth0
VBoxManage modifyvm "linux-server" --nic2 bridged --bridgeadapter2 eth1
VBoxManage modifyvm "linux-server" --nic3 bridged --bridgeadapter3 eth2
VBoxManage modifyvm "linux-server" --nic4 bridged --bridgeadapter4 eth3
but it made no difference. I also ran:

Code: Select all

vboxmanage controlvm "linux-server" setlinkstate1 on
vboxmanage controlvm "linux-server" setlinkstate2 on
vboxmanage controlvm "linux-server" setlinkstate3 on
vboxmanage controlvm "linux-server" setlinkstate4 on
but still no joy. I also went into webmin and set up all four network ports again with static ip's but on reboot the ip's are all different numbers given by dhcp. I also tried manually editing:

Code: Select all

/etc/sysconfig/network-scripts/ifcfg-enp0s3
/etc/sysconfig/network-scripts/ifcfg-enp0s8
/etc/sysconfig/network-scripts/ifcfg-enp0s9
/etc/sysconfig/network-scripts/ifcfg-enp0s10
but still the ip's are not what they should be. I'm stumped here...
Last edited by neuronetv on 2. Sep 2014, 22:59, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vm ignores network port settings

Post by Perryg »

What makes you think this is a VirtualBox issue? From what I see so far it looks like a guest setup problem.
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

Re: vm ignores network port settings

Post by neuronetv »

if it's a problem in the guest I'm still stumped as to how to solve it.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vm ignores network port settings

Post by Perryg »

Last I checked Linux incorporated around 300+ different OSes so not knowing what the guest really is makes it impossible to tell you where to seek assistance, but if you know what the OS is you could ask the forum of the particular OS for network assistance as that would be outside the scope of this forum.
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

Re: vm ignores network port settings

Post by neuronetv »

the host os is centos 6.5, the guest vm is centos 7, however I'm not so sure the problem is in the guest, I think I may be missing a vboxmanage command in the host that sets up the network ports for the vm but I can't figure out what it it.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vm ignores network port settings

Post by Perryg »

I also went into webmin and set up all four network ports again with static ip's but on reboot the ip's are all different numbers given by dhcp.
This is saying that as far as VirtualBox is concerned it has done its thing.
Question, can you ping the host from the guest and from the guest to the host using the addresses they actually have now? Also have you allowed for the traffic in any of your firewalls if you have them active? Are the machines in the same subnet?
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

SOLVED: Re: vm ignores network port settings

Post by neuronetv »

I managed to get round this problem in a newbie sort of way....
In the guest I used nmtui (NetworkManager-tui) to set up the static ip's again from scratch. Restarting the network service failed however so I deleted the four enp0s* files in /etc/sysconfig/network-scripts and then the network service restarted. Then I did a reboot and (I think) the reboot generated a new set of enp0s* files and I had my original ip's back. Thankyou for your attention on this problem.
Post Reply