Forum › Forums › General › Tips and Tricks › See active network connection in LiveUSB
- This topic has 26 replies, 7 voices, and was last updated Mar 31-4:57 pm by seaken64.
-
AuthorPosts
-
March 4, 2019 at 11:12 am #19072Member
seaken64
Forgive me if I have this topic in the wrong place. I’m not sure where this topic fits. I thought Tips and Tricks was appropriate but what do I know?
How do I display an active network connection when the device assigned is out of range for Conky?
When I use a LiveUSB with persistance on several different computers the network interfaces get assigned to device ID’s that are out of range for the standard Conky script. Conky is setup to show eth0, eth1, wlan0 and wlan1. But if the interface is assigned to eth3 or wlan2 it will not show in the Conky.
I could edit the Conky config file. But that is a lot of work for a short live session. I could add several more lines of text to add more interface numbers but what if the device ID’s don’t match? I also could just use the terminal and look up ifconfig. But it would be nice to see the network interface on the taskbar or in the Conky to confirm that I have a live connection. Maybe I could install a widget in the panel to show network interfaces?
I found a widget setting in the IceWMcc for displaying the network interface and I clicked through the settings to turn it ON then logged out and logged in. It didn’t work. I opened up the IceWM config files using the Control Centre and found the setting. It was set to show with a “=1” but the devices were listed as “ppp0 eth0”. I edited the devices to read “eth0 eth1 eth2 eth3′ and saved, then logged out/in.
It worked. The widget showed the eth3 interface, which is the ID assigned when I booted up this LiveUSB. (This laptop is using a PCMCIA wired ethernet connection).
(It seems that this widget only works for ethernet or modem? I switched to another laptop that is using wifi only. When I added the wlan2 device it does not work. But it does show an eth2 interface that is not connected to an ethernet wire).
But this is the same problem I have with Conky. The default interfaces that are entered in the config files are out of range for the ID’s assigned at boot time. When I booted this LiveUSB on this laptop I get “eth3” because eth0, eth1, and eth2 were already used on previous live sessions from other computers. I suppose I could just edit the file to include about 10 ID’s for both the ethernet and wifi interfaces. Is that the best I can do? I could do that in Conky also. I was looking for a more dynamic widget.
Seaken64
March 4, 2019 at 11:29 am #19075Anonymous
::Iftop generates an updated list of the network interfaces and its connections and also listens to traffic on an interface (or all interfaces) and displays the bandwidth usage on each one. You could make it autostart.
March 4, 2019 at 11:30 am #19076Anonymous
March 4, 2019 at 1:52 pm #19094Forum Admin
BitJam
::When I use a LiveUSB with persistance on several different computers the network interfaces get assigned to device ID’s that are out of range for the standard Conky script. Conky is setup to show eth0, eth1, wlan0 and wlan1. But if the interface is assigned to eth3 or wlan2 it will not show in the Conky.
This sounds like a bug. The labeling of network devices on one machine should not affect the labeling on other machines. This is done by saving the files listed in /live/boot-dev/antiX/state/machine-state-files on a machine by machine basis. The file we are using for network device naming is: /etc/udev/rules.d/*-persistent-net.rules. Perhaps this file is no longer being generated or perhaps it is being stored in a different location now.
You would also get this result if you disabled saving state on the live system. You can ensure saving state is enabled if you use the “savestate” boot option. This option is sticky so you only need to use it once. It should be in the “F4 Options” menus in the legacy bootloader.
If you weren’t saving state then after enabling with “savestate” you need to remove the existing /etc/udev/rules.d/*-persistent-net.rules file. This is best done by using “bp=b9” to get to a Bash shell before the real init program runs. Remove the file and then exit to continue with the boot process.
If the file has been moved to a different locate then add that new location to the list in /live/boot-dev/antiX/state/machine-state-files but you will also need to use the “bp=b9” trick to remove the existing versions of the file so the numbering of the network interfaces can start again with “1”.
If the location has been moved, you should be able to find the new location with the command:
sudo find / -name "*-persistent-net.rules"Context is worth 80 IQ points -- Alan Kay
March 4, 2019 at 2:55 pm #19099Memberseaken64
::A little more information. I had been using the default “demo” user and decided to add my own username and make it the default user. When I logged in I noticed that the Seamonkey browser needed to be setup with my bookmarks and passwords for the forums. This makes sense since my new user has it’s own profile. I finished the Seamonkey setups and browsed around the forums during lunch. I then did the remaster.
After I rebooted I did not have the Wifi connection so I went to Ceni. I noticed that now Ceni has this Wifi interface set to wlan0. Previously it was set to wlan2. Anyway, After I connected the Conky now shows the wlan0 up/down as usual. This makes sense again since Conky is set to show wlan0 and wlan1.
I will look into this later and follow your directions above as to what to look for. But I think I may be able to sort this out without editing the Conky config file.
Seaken64
March 4, 2019 at 3:17 pm #19104Memberseaken64
::male, here’s the output you requested:
inxi -nxxx
Network:
Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: Hewlett-Packard driver: r8169 v: 2.3LK-NAPI port: 4000 bus ID: 01:00.0
chip ID: 10ec:8168
IF: eth0 state: down mac: 08:2e:5f:8c:dd:c5
Device-2: Intel Centrino Wireless-N + WiMAX 6150 driver: iwlwifi v: kernel
port: 4000 bus ID: 07:00.0 chip ID: 8086:0886
IF: wlan0 state: up mac: 40:25:c2:e1:3a:68
Device-3: Intel type: USB driver: i2400m_usb bus ID: 2-1.5:4 chip ID: 8087:07d7
IF: wmx0 state: down mac: 64:d4:da:70:ee:ef
March 4, 2019 at 11:18 pm #19122Anonymous
::I’m not quite sure if I can still follow what you are talking about.
If you have 1 (one) and only one WiFi card, then it can only be cold ‘wlan0’ and NEVER ‘wlan1’, ‘wlan2’, ‘wlan3’ …
If you have 1 (one) and only one Ethernet card, then it can only be cold ‘eth0’ and NEVER ‘eth1’, ‘eth2’, ‘eth3’ …The ONLY way you might ever in your life see something like ‘eth3’ or ‘wlan4’ is:
You did a custom PC build and you know exactly what you are doing and why or you’re an IT professional working in an computer center.
The only other possible reason is: you have some broken configuration files (who~ or whatever caused it).The very probable cause for that behavior you mentioned yourself:
When I use a Live USB with persistence on several different computers the network interfaces get assigned to device ID’s that are out of range for the standard Conky script.
… since every Live USB with persistence behaves just like a ‘real’, installed OS — it does the HW recognition once and is not resetting and re-recognizing the HW all over again when you change the HW. So, if you are using it on different HW, you’ll have to reset the configuration manually and restart the HW discovery again, each time you change your HW. Those ‘device ID’s out of range’ are not ‘out of range’ but the devices with the wrong assigned ID’s.
The solution is easy:
1. Don’t use USB Pen drive with persistence
2. Make one USB Pen drive with persistence per HW used
3. Try using one USB Pen drive with persistence for all machines, creating another profile for each machine
[4. Somebody able to, writes a script that resets all HW discovery settings and restarts discovery/ID assignements again per single click]USB Pen drive with persistence is anyway a complete nonsense — it’s completely unsuitable for any kind of serious work.
The only purposes for Live USB are: Demonstrating an OS, installing OS or sometimes saving some file from some machine.March 5, 2019 at 1:12 pm #19154Anonymous
::male, here’s the output you requested:
but I wrote of ALL
But no matter. BitJam has already hinted at the puzzle’s solution and noCloue confirms it (there’s no better way to write it).
Always look at your experiments the /etc/udev/rules.d/70-persistent-net.rules
and delete it before you start the new machine.March 10, 2019 at 5:55 pm #19310Memberseaken64
::male, here’s the output you requested:
but I wrote of ALL
But no matter. BitJam has already hinted at the puzzle’s solution and noCloue confirms it (there’s no better way to write it).
Oops, you’re right of course. Sorry I missed that. But I don’t think I really have any problem computers. I may have had a temporary issue with the persistence files. I am trying all this for the first time and probably did something wrong.
Seaken64
March 10, 2019 at 5:59 pm #19311Memberseaken64
::You would also get this result if you disabled saving state on the live system. You can ensure saving state is enabled if you use the “savestate” boot option. This option is sticky so you only need to use it once. It should be in the “F4 Options” menus in the legacy bootloader.
If you weren’t saving state then after enabling with “savestate” you need to remove the existing /etc/udev/rules.d/*-persistent-net.rules file. This is best done by using “bp=b9” to get to a Bash shell before the real init program runs. Remove the file and then exit to continue with the boot process.
If the file has been moved to a different locate then add that new location to the list in /live/boot-dev/antiX/state/machine-state-files but you will also need to use the “bp=b9” trick to remove the existing versions of the file so the numbering of the network interfaces can start again with “1”.
If the location has been moved, you should be able to find the new location with the command:
sudo find / -name "*-persistent-net.rules"It seems likely that I had the savestate messed up somehow. I’ll probably never know for sure what I did but it seems to have worked itself out.
Thank you
Seaken64March 10, 2019 at 6:09 pm #19312Memberseaken64
::The solution is easy:
1. Don’t use USB Pen drive with persistence
2. Make one USB Pen drive with persistence per HW used
3. Try using one USB Pen drive with persistence for all machines, creating another profile for each machine
[4. Somebody able to, writes a script that resets all HW discovery settings and restarts discovery/ID assignements again per single click]USB Pen drive with persistence is anyway a complete nonsense — it’s completely unsuitable for any kind of serious work.
The only purposes for Live USB are: Demonstrating an OS, installing OS or sometimes saving some file from some machine.Thank you NoClue, your input is helpful. And I don’t exactly know what I am doing. Yet.
But I respectfully disagree. I like the idea of a LiveUSB with persistence. And I think the creators of this unique antiX persistence system will also have their own opinions on why it can be useful. Some of my serious work involves helping some folks with their home computers. I can keep lessons on my own disk and carry it from house to house. I can look at their hardware without touching their hard drive. It is also convenient to keep a separate drive for privacy and security. There are lots of good ways to use this persistence system.
I used to use Puppy or Knoppix. I like antiX better. I intend to use the antiX live system as my exclusive persistence distro. And I thank the developers for making it available. I’ll soon have a handle on how it all works and be putting it to use.
Thanks again,
Seaken64March 10, 2019 at 6:13 pm #19313Memberseaken64
::I experimented with two separate LiveUSB drives. One is a drive I’ve had for awhile and was started with antiX-17. The second is new and using the current 17.3.1. Both are 32-bit and installed on 8Gb USB with persistence. The older one is set to persist-all. The newer one is set to persist-static. The older drive gives an error when booted on a computer with less than 2Gb of RAM but I choose to “C”ontinue and it continues to boot with no apparent problems. (I’m assuming it uses a general static file instead of the root persistance file. But I don’t really know this).
I have several computers that have a Broadcom ethernet or Wifi adapter. Sometimes the LiveUSB does not detect either the ethernet or wireless adapter. I noticed that with my older LiveUSB it detects the wireless on one of my computers where the new one does not. But that same older USB does not detect the ethernet on a computer I have not tried it on yet. Once when I setup the blacklist file correctly and manually entered the correct driver using the modprobe command the wifi networking came to life.
After shutting down I looked at the saved state files and I can see the settings are saved for each machine. I put it in another machine and that machine also gets it’s own settings files. When I put the older USB back in a machine it has already been in, and reboot, the network does not start automatically. But I can run Ceni and reconfigure and it works. This may be because the root persistance file is not loaded if I have to enter “C” to continue.
On the Ceni screen is a list of Logical Interfaces in the lower right portion of the Ceni screen. On the older USB this list includes at least two logical names that do not hold to the typical “wlanx” naming scheme. They are named wlx001nnnnnnnnn and wlx002nnnnnnnnn where the n’s are a bunch of letters and numbers. There is also eth1, eth2, eth3, and wlan2. On the new USB that list has eth0, eth3, wlan1, wlan2 and wlan3.
I do usually get the network interface to be either eth0, eth1, or wlan0 or wlan1. On some of my computers I have two ethernet adapters or two wireless adapters. On one laptop I have a third adapter named wmx1 assigned as ethernet.
So I get that the persistance routines are saving settings for each machine and that the interface is usually named eth0 or wlan0. But it does not seem to always work out that way. I have had both eth3 and wlan2 used. I can’t say it was not me who made that assignment. I may have played with selecting one of those Logical Devices from the list in an attempt to get the networking on when it didn’t happen automatically. But I don’t recall doing that or being successful at assigning one of those ID’s. All I can say is I have had eth3 or wlan2 and they do not show on the Conky by default.
It is not a problem. I have figured out a way to deal with it if the interface does not come up automatically or gets a device name other than the standard four ID’s. What I was hoping for was a more dynamic indicator on either the Conky or the task bar that will show whatever ID is in play. I haven’t found such a widget yet. As long as I get one of the four device ID’s used by Conky I don’t need to worry about it. I will try to pay closer attention in the future as to what I did that may have led to an eth3 or wlan2 ID assignment. I am curious as to how those non-standard Logical interface ID’s got on the Ceni list. Where did they come from?
Seaken64
March 10, 2019 at 7:02 pm #19320Forum Admin
BitJam
::It seems likely that I had the savestate messed up somehow. I’ll probably never know for sure what I did but it seems to have worked itself out.
I agree with you. The symptom you had would be explained by having savestate disabled but persistence enabled. Since “savestate” and “nosavestate” are both sticky, it is easy to disable this feature and not notice until you get a problem like the one you originally described.
I strongly disagree with what noClue said. It might be true for most live systems but I don’t think it applies to ours. A number of people use our live system with persistence as their main system. Some people use it as their only system. Our lead developer does his development on our live system with persistence. He has been doing this for many years. The savestate feature was designed to let one live-usb work with persistence on different hardware systems. And as you have probably seen, it is really easy for the user to program which files get saved and which get saved on a machine by machine basis in case we missed something.
Over on the MX forums we are using some of the special features of our live system to help someone debug a hardware/kernel issue (I think) that prevents them from installing. We recently won an award for having the very best Linux live-usb system. Several people who had been running Knoppix for years changed to using our live system with persistence because it was more stable and worked better. They’ve been amazed by the stability. You can find at a little more about our live system from this article: The Most Extensive Live-usb on the Planet!
Context is worth 80 IQ points -- Alan Kay
March 10, 2019 at 7:18 pm #19322Moderator
caprea
::Im so glad you made this statement, BitJam, there are so many ways and reasons to use a live-usb with persistence serious.
March 10, 2019 at 7:26 pm #19323Anonymous
::As long as I get one of the four device ID’s used by Conky I don’t need to worry about it.
an option for you to consider:
sudo apt install ifrename
.

-
AuthorPosts
- You must be logged in to reply to this topic.