The small linux problem thread

MACVLAN is very easy with LXD/LXC. In the profile set the nictype to macvlan and the parent to your device (for example, eno1). Then your containers will DHCP an IP and be accessible over your LAN.

Unfortunately due to how MACVLAN works they won’t be accessible from the host. There’s no easy way around that, supposedly you need to create a MACVLAN bridge on the host and use that rather than your raw device, but I haven’t gotten it to work. Not a big deal for my use-case but I’d like to get it working at some point.

I really wouldn’t recommend using LXD or LXC without Ubuntu as the host. Canonical develops it and it works best in that distribution. If you aren’t using Ubuntu or Proxmox, stick with Docker or VMs.

Docker is also an attractive choice with Portainer, but I prefer the way LXCs are persistent and work like VMs as opposed to ephemeral application-specific Docker containers usually reliant upon a third-party maintainer.

You can get Docker containers to DHCP IPs too with MACVLAN, but I haven’t looked into it in any detail. I really hate all that port forwarding nonsense.

1 Like

could anyone recommend a VM software that will allow me to do GPU passthrough and share my 4TB secondary HDD? i’ve gone from virtualbox (with no GPU passthrough as I understand it) to KVM where I cant seem to share my drive (or figure out how to) and now im installing vmware to see if I can make any headway there but I’ve heard it can be buggy on linux?

I did some more digging and appearently if I install a secondary GPU then I can “pass through” that in virtual box. Gonna try it out and see what happens.

Update: having issues figuring out how exactly to pass through my secondary GPU any advice would be great. Some info below.

OS latest manjaro kde
GPU for host gtx 960ssc by EVGA
GPU for guest gtx 1060 FE
Vm software virtual box, have virt-manager installed as well.
If any more info is needed let me know

currently the small but big issue im having is nvidia control panel will not save xserver config files correctly making 1 setting not saved on reboot monitor position.

Use the “Save to X Configuration File” to a .conf file that you save in /etc/X11 with root privileges.

So, after screwing with lxc for a few hours, I have come across a few issues/observations.

First, it would appear that the Fedora template is broken/out of date/very unstable. I can’t get a reliable, usable Fedora container running for the life of me.

When trying to create an Ubuntu container using the template it throws an error and doesn’t finish the setup. I need to use Ubuntu for the clonedeploy server I want to set up, so it’d be nice to get that going.

ubuntu error

: Configuring libc-bin…
I: Configuring systemd…
I: Configuring ca-certificates…
I: Configuring initramfs-tools…
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See /var/cache/lxc/bionic/partial-amd64/debootstrap/debootstrap.log for details (possibly the package rsyslog is at fault)
I: Configuring rsyslog…
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See /var/cache/lxc/bionic/partial-amd64/debootstrap/debootstrap.log for details (possibly the package rsyslog is at fault)
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See /var/cache/lxc/bionic/partial-amd64/debootstrap/debootstrap.log for details (possibly the package rsyslog is at fault)
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See /var/cache/lxc/bionic/partial-amd64/debootstrap/debootstrap.log for details (possibly the package rsyslog is at fault)
W: Failure while configuring base packages. This will be re-attempted up to five times.
W: See /var/cache/lxc/bionic/partial-amd64/debootstrap/debootstrap.log for details (possibly the package rsyslog is at fault)
lxc-create: lxccontainer.c: create_run_template: 1427 container creation template for ubuntu01 failed
lxc-create: tools/lxc_create.c: main: 326 Error creating container ubuntu01

I have a successful and working CentOS container going, So that’s cool. I was able to attach it to a bridge from the host, and it gets its own MAC address, so I can assign it a static IP. I was able to install qbittorrent-nox, and can access the web interface from other computers on the LAN. Almost there. However, when I start a torrent download, it looks like it starts to download, then stops. There are lots of peers (ubuntu iso as an example), but it doesn’t download. I have no idea why. I installed qbittorrent-nox directly on the host, connected to the web interface, and it downloads just fine. Something with the container is messing that up,

in that config the meta modes are “#removed” is that my problem?

You should have atleast 1 metamodes. For example mine:

Option         "metamodes" "3440x1440_120 +0+0"

Once you make your needed changes click Apply, then Save to X Configuration, saving in /etc/X11.

I just tried the “lxc-create -t ubuntu -n ubuntu-c1” and “lxc-start -F -n ubuntu-c1” commands. Works.

You can run debootstrap directly. I described that in another thread using systemd-nspawn.

This isn’t a linux problem as much as a code building problem but uhhhh

Building something. Says I need SDL. Install SDL. Says I need SDL 1.2.0, I have 1.2.5.

Uhhhhh.

Have you tried symlinking the so?

I’m going to be honest with you here.

I have no idea how to do that.

Any time I read it on the arch wiki its written in spaceman and I have no idea what its asking me to do.

ln -s filename.1.2.5.so filename.1.2.0.so

I remember the ln-s command from when I compiled my kernels

To elaborate on this, you’ll go into /usr/lib or /lib or /usr/local/lib or wherever the so for SDL is. Mine (fedora) ins in /usr/lib/libSDL-1.2.so.0 and /usr/lib64/libSDL-1.2.so.0 (which is version 1.2.15).

Typically, you use this to hack in support for something like version 1.1 or 1.0 from version 1.2. The command you’d do is something along the lines of cd /usr/lib64 && ln -s libSDL-1.1.so.0 libSDL-1.2.so.0.

Frankly, I’m not sure that SDL versions that specifically, and your problem may be the detection script looking for an exact version, instead of “at least x”

the config will not safe to the active config it goes to the defaultsettings config file and the only way for me to edit the config was from the terminal and just removed the comment out for meta modes and everything worked on reboot.

Do you guys have a go-to method for checking CPU frequency programmatically in Linux (preferably distro-agnostic)? Currently, I’m using lscpu | grep "MHz" | awk '{ print $3 * 1000000; }' but it is not working well in all cases.

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq has been suggested but doesn’t exist in the CentOS VM I’m testing.

02

watch -n.1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""

It checks in real time.

1 Like

Thanks, I forgot about that one.

Going to try this out:

grep -m 1 MHz /proc/cpuinfo | awk '{ print $4 * 1000000 }'

I’m trying to catalog some portable commands that I can use between different distributions.

So /cat/proc/cpuinfo shows real-time frequency, which is nice, but I actually want the processor spec.

Script
#!/usr/bin/env sh
#
# prints cpu frequency in hertz


# bsd

sysctl -n machdep.tsc_freq 2>/dev/null ||


# linux

( lscpu |
  grep --ignore-case "mhz" |
  awk '{ printf "%d\n", ( $3 + $4 ) * 1000000 }' |
  sort --numeric-sort --reverse |
  head -1 
) 2>/dev/null ||


# macos

sysctl -n hw.cpufrequency_max 2>/dev/null ||


exit 1 #fail

exit 0 #success