Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If I understand correctly you run a virtual machine from windows. This VM is running Debian and it is being used to build LFS.
The Windows IP Configuration isn't of any concern, virtualbox will give the host (Debian/LFS) unique network settings which are unrelated to the windows network configuration (not entirely true, but lets keep this as simple as possible).
Looking at the ifconfig command (the one executed from Debian) I see that your VM has set 10.0.2.X to be used as IP range and 10.0.2.15 is your hosts ip.
You mention that your host has 1 network interface. What I find strange is that I see 2 HW addresses and mention of eth2 and eth1. This might be due to the following: When copying/cloning VM's the assigned HW address changes, which in turn changes the eth designation (eth0 -> eth1 -> eth2 -> ...).
Did you clone/copy the VM running Debian while working on LFS?
Can you post the following information after a reboot (post all the generated output):
From windows:
- ipconfig
Edit: just noticed something interesting: Both you and AN28 use the exact same blog to note down your experiences (ChillPil) ..... One and the same person?
Did you clone/copy the VM running Debian while working on LFS?
Yes, clone happened twice. Also the clones were run on several machines.
I'll post the details later as I'm not on my host machine at the moment.
However, have to make a small clarification.
Quote:
Originally Posted by druuna
Edit: just noticed something interesting: Both you and AN28 use the exact same blog to note down your experiences (ChillPil) ..... One and the same person?
No, we are not the same person. I do not see the point of having two separate usernames. We are team-members of the same project, building our LFS systems separately.
root@Dee:/home# dmesg | egrep -i "eth|e1000"
[ 4.594924] e1000 0000:00:03.0: PCI INT A -> Link[LNKC] -> GSI 10 (level, low) -> IRQ 10
[ 4.595015] e1000 0000:00:03.0: setting latency timer to 64
[ 5.225523] e1000: 0000:00:03.0: e1000_probe: (PCI:33MHz:32-bit) 08:00:27:b9:55:5a
[ 5.430131] e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
[ 40.105243] udev[227]: renamed network interface eth0 to eth2
[ 59.554047] e1000: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[ 69.867623] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 70.464170] eth2: no IPv6 routers present
[15920.708517] e1000: eth2 NIC Link is Down
[15925.568914] e1000: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
root@Dee:/home# dmesg | egrep -i "eth|e1000"
[ 4.594924] e1000 0000:00:03.0: PCI INT A -> Link[LNKC] -> GSI 10 (level, low) -> IRQ 10
[ 4.595015] e1000 0000:00:03.0: setting latency timer to 64
[ 5.225523] e1000: 0000:00:03.0: e1000_probe: (PCI:33MHz:32-bit) 08:00:27:b9:55:5a
[ 5.430131] e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
[ 40.105243] udev[227]: renamed network interface eth0 to eth2
[ 59.554047] e1000: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[ 69.867623] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 70.464170] eth2: no IPv6 routers present
[15920.708517] e1000: eth2 NIC Link is Down
[15925.568914] e1000: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
root@Dee:/home# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
root@Dee:/home# ifconfig
eth2 Link encap:Ethernet HWaddr 08:00:27:b9:55:5a
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:feb9:555a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:32898 errors:0 dropped:0 overruns:0 frame:0
TX packets:22249 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28972009 (27.6 MiB) TX bytes:1896318 (1.8 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 B) TX bytes:560 (560.0 B)
root@Dee:/home# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:c3:73:39", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:1f:76:9b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:b9:55:5a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
root@Dee:/home# cat $LFS/etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device e1000
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:1f:76:9b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
Looking at the LFS 70-persistent-net.rules that was created the network interface is on eth1 with hardware address 08:00:27:1f:76:9b and looking at the Debian output I see that the interface is on eth2 with hardware address 08:00:27:b9:55:5a (HW address 08:00:27:1f:76:9b is mentioned on Debian, but is on eth1 and not used).
Did you make a clone after the LFS 70-persistent-net.rules was created?
You could try the following (the LFS side of things):
- Add the following to the $LFS/etc/udev/rules.d/70-persistent-net.rules:
I can't determine from the given info which gateway needs to be used (bold blue part). Try the following (on Debian):
Code:
route -n | egrep "Gateway|UG"
Use the IP mentioned under the Gateway header.
I'm not familiar with virtualbox and how you have set up networking. If the gateway setting doesn't work you could try either of these 2 IP's:
- 10.17.58.1
- 10.0.2.1
I hope you do know by now that every time you clone your VM the HW Address changes and as a result you need to change configuration settings to make things work again.
Just a small doubt guys, what is the best way to find what the primary/secondary nameserver is ??
we need to specify it when creating the /etc/resolv.conf file
Code:
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf
domain <Your Domain Name>
nameserver <IP address of your primary nameserver>
nameserver <IP address of your secondary nameserver>
# End /etc/resolv.conf
EOF
I tried the following commands but they weren't too helpful:
Code:
root@Dee:/# cat /etc/resolv.con
cat: /etc/resolv.con: No such file or directory
Code:
root@Dee:/# dig -t ns xxxxx.xxxx.com
dig: parse of /etc/resolv.conf failed
Thank you for the information found the nameservers
@Drunna sorry about that but it is with reference to the successive section after which was being discussed here.
That is why I posted the comment on this thread. Anyway next time I shall use a new one
I hope you do know by now that every time you clone your VM the HW Address changes and as a result you need to change configuration settings to make things work again.
My heartiest thanks druuna, this was really helpful and solved my issue.
Just a small question to gain knowledge regarding the ifconfig file name. The original .rules file is for eth1 while the Debian output gives eth2. The modified file uses eth0. So are we trying to make the configuration the same as the host computer upone which the VM is running?
Is there a way to check if all is correct before running the completed LFS system?
If you only have one networkcard, the original name of it is eth0.
Then was created a persistant network rule so that the mac-adress of that device always has the name eth0.
When you clone your vm (or move the harddrive to another computer) the mac-adress for the networkcard is changed, and then udev creates a new rule for it, and gives it the name eth1.
In some distros this happen automatic, but in other you need to manually change the udev rule, if you move the system to new hardware.
Then was created a persistant network rule so that the mac-adress of that device always has the name eth0.
When you clone your vm (or move the harddrive to another computer) the mac-adress for the networkcard is changed, and then udev creates a new rule for it, and gives it the name eth1.
In some distros this happen automatic, but in other you need to manually change the udev rule, if you move the system to new hardware.
Again, a very much related question.
I had successfully cloned the LFS build on virtualbox in the same computer.
I recently tried copying my LFS virtualbox file to a virtualbox on another computer. I've changed the IP addresses etc. as well as the MAC address in the 70-persistent-rules file. But still I cannot connect to the Internet.
A small nudge on how to manually change the udev rule is very much appreciated.
Do I have to assume that that worked and you are able to boot into (B)LFS without any errors?
Everything works fine other than the fact that the system prints out the following message at startup.
Code:
Bringing up the eth0 interface... Cannot find device eth0 [FAIL]
Quote:
Originally Posted by druuna
Changed it to what? Did you follow the "procedure" I posted in posts #2 and #6?
Yes, I changed /etc/sysconfig/ifconfig.eth0 and /etc/udev/rules.d/70-persistent-net.rules. For the 70-persistent-net.rules, I changed the ATTR{address} parameter as well to the MAC address of the NIC card of the new VM(This was taken from the VM settings)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.