The small linux problem thread

Thank you, then apparently I misunderstood the whole point of it…

I’ll look into the ssh_config later on, otherwise a couple lines in the bashrc or profile should also do, right?

Avoid bashrc… putting the wrong things in there can break scp, rsync’ing into that system, and other stuff.

.bash_profile or .profile for ssh-add can be fine if your desktop starts up the ssh-agent for you. If you want to use ssh-agent outside of your desktop env, you’ll need in your profile script to check if SSH_AUTH_SOCK is set, and only if not, start-up ssh-agent yourself before doing the ssh-add’s.

2 Likes

I have two computers A and B connected each to a common switch. Both computers are connected with one another trough a faster ethernet connection. I have problems configuring the network.

The following are the settings for the network setup on machine B, where enp6s0 is the slow connection to the switch and enp8s0 is the fast connection to A:

IPv4 address for enp6s0: 192.168.1.40
IPv6 address for enp6s0: 2aa2:8100:a1a1:9cc9:1e1e:dffd:feef:e8e8
IPv4 address for enp8s0: 192.168.2.2
IPv4 address for enp8s0: 192.168.1.40

The network settings using netplan on B are as follows:

network:
  ethernets:
    enp6s0:
      dhcp4: true
      optional: true
      wakeonlan: true
    enp8s0:
      dhcp4: false
      optional: true
      wakeonlan: true
      addresses: [192.168.2.2/24]
  version: 2

The connections seem not to work correctly. I can ssh from computer A into computer B, but when I am trying to ping computer A and a random computer C on the network I sometimes get responses, sometimes not. So I guess something is wrong with the routing? Any kind of help is greatly appreciated.

Sorry I didn’t read this carefully. You’re copying the public key to the other server. I don’t think that’s the issue here.

1 Like

First problem, you’re showing the same IP address on enp6s0 and enp8s0. Typo?

Do a ping flood. Get back to us with actual numbers on how many and in which pattern they work, and don’t. Just sometimes get responses, sometimes not is too vague to help.

Run tcpdump on the source and destination, then you’ll see if the ping packet goes out from the source, on the right interface, if the destination receives it, and if it sends a response back the right way. Then you might have an idea where the problem occurs.

1 Like

@rcxb

Nope it is not a typo, ip addr says:

2: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.2/24 brd 192.168.2.255 scope global enp8s0
       valid_lft forever preferred_lft forever
    inet 192.168.1.40/24 brd 192.168.1.255 scope global enp8s0
       valid_lft forever preferred_lft forever
3: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.40/24 brd 192.168.1.255 scope global dynamic enp6s0
       valid_lft 863924sec preferred_lft 863924sec
    inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 7127sec preferred_lft 3527sec
    inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link 
       valid_lft forever preferred_lft forever

computerA pings computerB at 192.168.1.40
sudo tcpdump -i enp6s0 icmp

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp6s0, link-type EN10MB (Ethernet), capture size 262144 bytes
18:41:04.890572 IP computerA.fritz.box > computerB: ICMP echo request, id 2, seq 1, length 64
18:41:04.890653 IP computerB > computerA.fritz.box: ICMP echo reply, id 2, seq 1, length 64
18:41:05.893161 IP computerA.fritz.box > computerB: ICMP echo request, id 2, seq 2, length 64
18:41:05.893234 IP computerB > computerA.fritz.box: ICMP echo reply, id 2, seq 2, length 64

computerB pings computerA at 192.168.1.25
sudo tcpdump -i enp5s0 icmp

tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on enp5s0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
20:45:35.586056 IP computerB.fritz.box > computerA.fritz.box: ICMP echo request, id 1, seq 1, length 64
20:45:35.586086 IP computerA.fritz.box > computerB.fritz.box: ICMP echo reply, id 1, seq 1, length 64
20:45:36.601196 IP computerB.fritz.box > computerA.fritz.box: ICMP echo request, id 1, seq 2, length 64
20:45:36.601244 IP computerA.fritz.box > computerB.fritz.box: ICMP echo reply, id 1, seq 2, length 64
20:45:37.625172 IP computerB.fritz.box > computerA.fritz.box: ICMP echo request, id 1, seq 3, length 64
20:45:37.625219 IP computerA.fritz.box > computerB.fritz.box: ICMP echo reply, id 1, seq 3, length 64
20:45:38.653595 IP computerB.fritz.box > computerA.fritz.box: ICMP echo request, id 1, seq 4, length 64
20:45:38.653643 IP computerA.fritz.box > computerB.fritz.box: ICMP echo reply, id 1, seq 4, length 64

computerA pings computerB at 192.168.2.2
sudo tcpdump -i enp8s0 icmp

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp8s0, link-type EN10MB (Ethernet), capture size 262144 bytes
18:46:53.401800 IP 192.168.1.1 > computerB: ICMP echo request, id 3, seq 1, length 64
18:46:53.401865 IP computerB > 192.168.1.1: ICMP echo reply, id 3, seq 1, length 64
18:46:54.427950 IP 192.168.1.1 > computerB: ICMP echo request, id 3, seq 2, length 64
18:46:54.428019 IP computerB > 192.168.1.1: ICMP echo reply, id 3, seq 2, length 64
18:46:55.440583 IP 192.168.1.1 > computerB: ICMP echo request, id 3, seq 3, length 64
18:46:55.440650 IP computerB > 192.168.1.1: ICMP echo reply, id 3, seq 3, length 64
18:46:56.454051 IP 192.168.1.1 > computerB: ICMP echo request, id 3, seq 4, length 64
18:46:56.454093 IP computerB > 192.168.1.1: ICMP echo reply, id 3, seq 4, length 64

computerB pings computerA at 192.168.2.1
sudo tcpdump -i enp6s0 icmp

tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on enp6s0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
20:48:19.640054 IP 192.168.1.2 > computerA: ICMP echo request, id 2, seq 1, length 64
20:48:19.640111 IP computerA > 192.168.1.2: ICMP echo reply, id 2, seq 1, length 64
20:48:20.666131 IP 192.168.1.2 > computerA: ICMP echo request, id 2, seq 2, length 64
20:48:20.666177 IP computerA > 192.168.1.2: ICMP echo reply, id 2, seq 2, length 64
20:48:21.690263 IP 192.168.1.2 > computerA: ICMP echo request, id 2, seq 3, length 64
20:48:21.690309 IP computerA > 192.168.1.2: ICMP echo reply, id 2, seq 3, length 64
20:48:22.713685 IP 192.168.1.2 > computerA: ICMP echo request, id 2, seq 4, length 64
20:48:22.713726 IP computerA > 192.168.1.2: ICMP echo reply, id 2, seq 4, length 64
20:48:23.737697 IP 192.168.1.2 > computerA: ICMP echo request, id 2, seq 5, length 64
20:48:23.737728 IP computerA > 192.168.1.2: ICMP echo reply, id 2, seq 5, length 64

So pinging the IPs directly seems to work. Still something is afoot.

computerB trying to ping computerA by hostname:
ping computerA

computerB trying to ping computerA by hostname:
ping computerA
PING computerA(computerA.fritz.box (xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:3ff5)) 56 data bytes
From computerB (xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:e855) icmp_seq=1 Destination unreachable: Address unreachable
From computerB (xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:e855) icmp_seq=2 Destination unreachable: Address unreachable
From computerB (xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:e855) icmp_seq=3 Destination unreachable: Address unreachable
^C
--- computerA ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5093ms

computerA trying to ping computerB by hostname:
ping computerB

PING computerB.fritz.box (192.168.1.40) 56(84) bytes of data.
64 bytes from computerB.fritz.box (192.168.1.40): icmp_seq=1 ttl=64 time=0.212 ms
64 bytes from computerB.fritz.box (192.168.1.40): icmp_seq=2 ttl=64 time=0.235 ms
64 bytes from computerB.fritz.box (192.168.1.40): icmp_seq=3 ttl=64 time=0.239 ms
64 bytes from computerB.fritz.box (192.168.1.40): icmp_seq=4 ttl=64 time=0.191 ms
^C
--- computerB.fritz.box ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3045ms
rtt min/avg/max/mdev = 0.191/0.219/0.239/0.019 ms

On computerA I have disabled IPv6 for enp6s0. IPv4 is set to address = 192.168.1.1 and netmask 255.255.255.0. In the GUI I have enabled the checkbox for “use this connection only for resources on its network”.

1 Like

Try a dig computerA.fritz.box A to make sure there’s a IPv4 record in your DNS, and not just the AAAA (IPv6) record. If you get the IPv4, then you’ll either have to either:
A) Tweak Linux to prefer IPv4 when resolving.
B) Disable IPv6 everywhere to ensure it ignores the AAAA records, or
C) Track down the problem with your IPv6 setup is

Since you’ve omitted or censored your IPv6 addresses, it’s unlikely anyone here will be able to help you with option C.

1 Like

Had a thought. Is there a vim plugin or setting that will wrap a document across a split with cohesive scrolling?

So the line numbers would be like:

==================================
|1               |13             |
|2               |14             |
|3               |15             |
|4               |16             |
|5               |17             |
|6               |18             |
|7               |19             |
|8               |20             |
|9               |21             |
|10              |22             |
|11              |23             |
|12              |24             |
==================================

And if the cursor goes down to the bottom on the left, it comes out at the top on the right and it all scrolls together.

I tried searching but if it exists, I can’t find the right term for it.

1 Like

So I’m a little stumped here.

I’ve edited the following into my /etc/fstab file:

//helios/music /home/colin/Music cifs credentials=/home/colin/.smbpassword 0 0

For some reason, the mount doesn’t work on startup. Here is my sudo journalctl | grep Music output:

May 24 20:28:15 jensen systemd[1]: home-colin-Music.mount: Mount process exited, code=exited, status=1/FAILURE
May 24 20:28:15 jensen systemd[1]: home-colin-Music.mount: Failed with result 'exit-code'.
May 24 20:28:15 jensen systemd[1]: Failed to mount /home/colin/Music.

However, after booting, if I run sudo mount -a, it mounts perfectly fine, with the only feedback being:

[  404.133818] CIFS: No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.
[  404.133820] CIFS: Attempting to mount \\helios\music

I’m pretty confused. How would mounting it from a terminal work, but not on boot? Is it somehow related to dependencies? Is it because the system is finished booting and all the dependency services are available?

1 Like

It’s possible that the boot-mount runs before the CIFS driver is loaded maybe?

2 Likes

Sounds like this?

You would just have to scroll to line X on one of them first before binding them I guess.

2 Likes

Yeah, probably more work than it’s worth… thanks though, this gives me the vocabulary I need to search more effectively.

1 Like

Add _netdev to the fourth field of your fstab.

4 Likes

I use this in bash and zsh scripts to handle stderr and logging. Been very happy with it, but wondering if there’s any way to make it posix compliant as I believe process substitution is not defined in posix.

(simplified for illustrative purposes)

debug=true
$debug && exec {fd}> >( tee /dev/fd/2 | logger ) || :
dbg="${fd-/dev/null}"
unset fd
...
some-command arg 2>&"$dbg"

Process substition is the >( part. Not sure how else to get the file descriptor to send to stderr and logger without tee in this way.

edit: looks like using {fd} like this is also a non-posix convenience, so idk how far I can get with this…

2nd edit: The best compromise appears to be named pipes.

(second answer)

1 Like

Hello everyone! Instead of opening a new thread I decided to hop on here to seek some help: I installed Arch from the installer on my laptop that’s using dual GPUs (one Intel one Nvidia). It is not loading the Nvidia driver and I’m not sure if that’s due to the absence of optimus or if I need to make it work first and than use optimus. Thanks!

1 Like

Are you running nomodeset as a command line argument on boot for the NV GPU? I don’t use NV or dual GPU systems so my help is limited.

2 Likes

No worries, I appreciate you chiming in! I don’t, it’s running straight off of the Intel HD4000 and with either the Nvidia official method or Optimus I should be able to engage the Nvidia GPU.

The Arch installer installed the wrong driver so that was an issue to begin with. So I had to build and install the 390xx driver with their dependencies since they’re not in the repo anymore. After I did that I managed to get some info about the system through the smi command.

I also installed the Nvidia X control panel, not knowing if I need it or not, and it suggested me to create a new xorg file. Created it and the installation broke. Had to recover the GUI from the console (CTRL + ALT + F3) but now I can’t log into an X11 session. In all of this I didn’t manage to test if the Nvidia GPU can render stuff or not (using one of the methods I talked about before).

So now, to avoid wasting time, I’m gonna re-install the system, install the drivers, maybe the Nvidia control panel, avoid the xorg configuration from Nvidia and try to launch anything with the Nvidia GPU.

1 Like

I don’t think that you need to modify the xorg file anymore. That was a legacy requirement. If you want to just ignore the igpu, you can just disable it in the bios.

Have you looked at the ArchWiki for some possible solutions?
https://wiki.archlinux.org/title/NVIDIA_Optimus
PRIME - ArchWiki (open source, vendor agnostic solution)
Bumblebee - ArchWiki (open source solution for NV GPUs)

2 Likes

Yeah, that’s absolutely true. But it comes up every time I open the Nvidia X control panel, which I don’t know if I need or not.

I can’t disable the Intel GPU because the Nvidia one is connected to the display through the Intel one. That’s how they achieve the switching graphics. If you meant disable the Nvidia GPU, I’d rather not since I’m gonna use Matlab on the system.

I did, I just messed it up before having a shot at trying one of them haha
I think I’m gonna have some time today to fix it up and try again.

2 Likes

how do i stop my terminal historys from corrupting at shut down of the vm?.

zsh: corrupt history file /home/user1/.zsh_history

i dont think its a privs thing coz sudo or not, the the terminal history is corrupted.
is it just because im closing the vm and not logging out first?

1 Like