LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Can't set static IP to Slackware VM in Virtualbox (http://www.linuxquestions.org/questions/slackware-14/cant-set-static-ip-to-slackware-vm-in-virtualbox-4175453780/)

PrinceCruise 03-12-2013 09:46 AM

Can't set static IP to Slackware VM in Virtualbox
 
Hello,

I've installed and set up a Slackware 14.0 VM in Virtualbox(4.2).
The Network setting is NAT and host-only-adapter (Vboxnet0). I have set the static IP address 192.168.56.101 to eth3 editing the /etc/rc.d/rc.inet1.conf file. Snippets of the file (Typed manually as the shared clipboard is also not working, so can't copy paste):-

Quote:

# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="no"
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth2:
IPADDR[2]=""
NETMASK[2]=""
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""

# Config information for eth3:
IPADDR[3]="192.168.56.101"
NETMASK[3]="255.255.255.0"
USE_DHCP[3]="no"
DHCP_HOSTNAME[3]=""

# Default gateway IP address:
GATEWAY=""
I've restarted inetd daemon, even rebooted the system, still the ifconfig doesn't show the IP address associated to eth3. Can't show the guest's ifconfig -a output here as copt paste is not working.

The local ifconfig o/p for vboxnet0 is -

Quote:

vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.1 netmask 255.255.255.0 broadcast 192.168.56.255
inet6 fe80::800:27ff:fe00:0 prefixlen 64 scopeid 0x20<link>
ether 0a:00:27:00:00:00 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 129 bytes 5634 (5.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I want to achieve simply ssh connectivity from guest to host and vice versa. I have two other VMs, CentOS 5 and 6 where this works fine.
I've searched a lot but didn't find something which could address the exact issue.Let me know what I'm missing here.

Regards.

tuxbg 03-12-2013 10:34 AM

Did you enable remote control in VirtualBox and choose the port?

pp
I dont think its posiblle to get static ip adress in vm

PrinceCruise 03-12-2013 10:43 AM

Quote:

Originally Posted by tuxbg (Post 4910038)
Did you enable remote control in VirtualBox and choose the port?

pp
I dont think its posiblle to get static ip adress in vm

The remote display has nothing to do with the static or dynamic IP address assignment and I'm not using ip port forwarding so no need to choose the port from the advance networking section.

And all my CentOS VMs use static IPs in Virtualbox, the issue is only with Slackware VM.

Regards.

NeoMetal 03-12-2013 11:06 AM

You don't have networkmanager or wicd enabled by accident and trying to grab a dynamic IP do you? Make sure /etc/rc.d/rc.networkmanager isn't executable


(Or is the issue that the interface is not being assigned an address at all? )

PrinceCruise 03-12-2013 11:14 AM

No, I checked that beforehand. Anyways I found the solution myself and its kinda weird. Sharing in case.

The default adapter for NAT and host-only-networking AMD PCNet FAST III turned out to be the culprit. I dug the dmesg output of the freshly booted VM and realized somethings wrong with this adapter type. Changed it to the Intel PRO/1000 MT Desktop (82540EM) and VOILA! eth3 has the static IP assigned now. Can connect from host using hostname and IP and the simple mission is accomplished.


Regards.


All times are GMT -5. The time now is 11:30 AM.