Talk:Proxmox Linux Container: Difference between revisions

imported>Vater
No edit summary
imported>Vater
Line 152: Line 152:
|  
|  
----
----
<!--
: <code>ping -c 5 cache.nixos.org</code>
<pre>
PING dualstack.v2.shared.global.fastly.net (151.101.114.217) 56(84) bytes of data.
64 bytes from 151.101.114.217 (151.101.114.217): icmp_seq=1 ttl=57 time=14.3 ms
64 bytes from 151.101.114.217 (151.101.114.217): icmp_seq=2 ttl=57 time=14.3 ms
64 bytes from 151.101.114.217 (151.101.114.217): icmp_seq=3 ttl=57 time=14.3 ms
64 bytes from 151.101.114.217 (151.101.114.217): icmp_seq=4 ttl=57 time=14.3 ms
64 bytes from 151.101.114.217 (151.101.114.217): icmp_seq=5 ttl=57 time=14.3 ms
--- dualstack.v2.shared.global.fastly.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 14.302/14.312/14.325/0.009 ms
</pre>
-->
|-
|-
| customize the (pve) lxc startup setup routine (on every node where you want to start a NixOS container)
| customize the (pve) lxc startup setup routine (on every node where you want to start a NixOS container)
Line 299: Line 314:
</pre>
</pre>
: <code>nixos-rebuild test</code>
: <code>nixos-rebuild test</code>
<!--
<pre>
building Nix...
building the system configuration...
</pre>
-->
<pre>
<pre>
building Nix...
building Nix...
Line 323: Line 344:
Oct 11 06:48:30 nixos systemd[1]: Failed to mount Kernel Debug File System.
Oct 11 06:48:30 nixos systemd[1]: Failed to mount Kernel Debug File System.
warning: error(s) occurred while switching to the new configuration
warning: error(s) occurred while switching to the new configuration
</pre>
|-
| checking systemd
|
|
: <code>systemctl list-units --failed</code>
<pre>
  UNIT                  LOAD  ACTIVE SUB    DESCRIPTION           
● sys-kernel-debug.mount loaded failed failed Kernel Debug File System
LOAD  = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
1 loaded units listed.
</pre>
</pre>
|-
|-
Line 354: Line 390:
<pre>
<pre>
}
}
</pre>
: <code>nixos-rebuild switch</code>
<pre>
building Nix...
building the system configuration...
</pre>
<pre>
these derivations will be built:
</pre>
<!--
these derivations will be built:
  /nix/store/70vn8sdp0vmkih8b6ankvfrgrrzcsqc3-builder.pl.drv
  /nix/store/73skknpbrxn3ma8x2z1hmilsz5xvxhc2-unit-systemd-vconsole-setup.service-disabled.drv
  /nix/store/qqqb2r0xy0kwkf20zq7g0nff3jw05rhy-nixos-version.drv
  /nix/store/yhkn5ifgvgyi5qqchxxf92sinryhgj0p-system-path.drv
  /nix/store/bangdpmh3ckia8bkh33w79ljafa696bm-unit-systemd-fsck-.service.drv
  /nix/store/c2b2sm2qq8320w3nq75liyml13mrwy16-configuration.nix.drv
  /nix/store/h2ca5yjzf69pvrpybbyx711dix1kdli8-etc-os-release.drv
  /nix/store/rgyxgl2piqnk3vnni9dvma1vssb11m3g-dbus-catalog.xml.drv
  /nix/store/hxv4wpgb7lr1dx70pa9mvfzfv73zgaph-dbus-1.drv
  /nix/store/r5w2f8sp18954mrr82va0f3mmrpv2nqv-unit-polkit.service.drv
  /nix/store/rssbhl1j6fd93y2wwhviasv7acjgyfp5-unit-dbus.service.drv
  /nix/store/k04nljvj479pxcapckaqyrynni3k0k3p-system-units.drv
  /nix/store/mdyyq44dl6ylnn2kk1zxa18wkzsw3ycj-issue.drv
  /nix/store/y0dk0w3mnjswz07jkzsrvxkl08pk4pz5-unit-dbus.service.drv
  /nix/store/qn86bsazs92g5pldbbn0c60vc09qx8x2-user-units.drv
  /nix/store/f2vy2kzjh8v445jdcfkkc8gz3j3m1gjw-etc.drv
  /nix/store/qjxd71i7nrbh15n419gslzsy5fcmgc01-nixos-21.05.3740.ce7a1190a0f.drv
  /nix/store/qn8iv33ys79rxvzymlmdn1s8j18pqwww-local-cmds.drv
  /nix/store/fz5jdljbpibg0r6gln5qllqiaqrk12nc-stage-2-init.sh.drv
  /nix/store/wvgj75jm6nc3zkdn0ky2lfv8y0jd00wn-nixos-system-nixos-21.05.3740.ce7a1190a0f.drv
these paths will be fetched (3.16 MiB download, 4.27 MiB unpacked):
  /nix/store/0946q0lawbbyz3blln78qv65hm0l9d9g-acl-2.3.0-man
  /nix/store/1fdyxjsh9fsyiyv77giq21b9h5232hph-stdenv-linux
  /nix/store/1hryqjd57545vry9ym8dzl43dmqf4lf4-util-linux-2.36.2-man
  /nix/store/3mlbnbrzy4i7cssdbpgds010514hkdkd-systemd-247.6-man
  /nix/store/4vkjqbcaczn3qcmy64c8yk29s6537991-ncurses-6.2-man
  /nix/store/5bv2p3cc06cfgc934cfpmvhgsvx60p41-libcap-2.48-man
  /nix/store/5mcrlz0dkwrhzck0db6dq19d45bbjcw0-bash-interactive-4.4-p23-man
  /nix/store/63mk52rhk47z705511x6fj7c6dvbih4g-xz-5.2.5-man
  /nix/store/63vf898w16yhrbpb7ib2yb6x3kjh4csh-curl-7.76.1-man
  /nix/store/71wmig7469qvcqxfgnnazpgd3g4bnnrd-libxslt-1.1.34-bin
  /nix/store/8kn2pcf5p1jc528kmslskgbycxcmvf42-getconf-1003.1-2008
  /nix/store/8mv2lnfhfdkvcfxmjlg42w99jd52rx9w-dbus-1.12.20-man
  /nix/store/9by2vb17x8q0cmqi3k4ryh6iwanvmrym-lndir-1.0.3
  /nix/store/9yk2k0j6xm1hq8rr651vlqx70nikqj94-libxslt-1.1.34
  /nix/store/dd5988vwnirs66qf5wp8inn4ixma9rlv-gzip-1.10-man
  /nix/store/jdl9wrpvkfcjw7yj1430icbfm7csjx5v-zstd-1.4.9-man
  /nix/store/ji2n6yjd47qklwpi06fcfngvycxb7k83-attr-2.4.48-man
  /nix/store/lw01h380nqrxxjxnv2756qfziyl8a6a6-gawk-5.1.0-man
  /nix/store/n4zsgk6bs4af95naymr00yx8nsrs828b-linux-pam-1.5.1-man
  /nix/store/r2imj0j1wzkhdq29g7hxj9nvlvvgwbgq-e2fsprogs-1.46.2-man
  /nix/store/syfk44gy7wqk33va9clqjxmh9yh47diw-bzip2-1.0.6.0.2-man
  /nix/store/x1bb87f971kjvgdkn9n9rnv4dzj6mikw-desktop-file-utils-0.24
  /nix/store/zzjkdpgwwsc0yr5f6prz9kqgzrmd3ry1-shadow-4.8.1-man
copying path '/nix/store/3mlbnbrzy4i7cssdbpgds010514hkdkd-systemd-247.6-man' from 'https://cache.nixos.org'...
copying path '/nix/store/0946q0lawbbyz3blln78qv65hm0l9d9g-acl-2.3.0-man' from 'https://cache.nixos.org'...
copying path '/nix/store/ji2n6yjd47qklwpi06fcfngvycxb7k83-attr-2.4.48-man' from 'https://cache.nixos.org'...
copying path '/nix/store/5mcrlz0dkwrhzck0db6dq19d45bbjcw0-bash-interactive-4.4-p23-man' from 'https://cache.nixos.org'...
copying path '/nix/store/syfk44gy7wqk33va9clqjxmh9yh47diw-bzip2-1.0.6.0.2-man' from 'https://cache.nixos.org'...
copying path '/nix/store/63vf898w16yhrbpb7ib2yb6x3kjh4csh-curl-7.76.1-man' from 'https://cache.nixos.org'...
copying path '/nix/store/8mv2lnfhfdkvcfxmjlg42w99jd52rx9w-dbus-1.12.20-man' from 'https://cache.nixos.org'...
copying path '/nix/store/x1bb87f971kjvgdkn9n9rnv4dzj6mikw-desktop-file-utils-0.24' from 'https://cache.nixos.org'...
copying path '/nix/store/r2imj0j1wzkhdq29g7hxj9nvlvvgwbgq-e2fsprogs-1.46.2-man' from 'https://cache.nixos.org'...
copying path '/nix/store/lw01h380nqrxxjxnv2756qfziyl8a6a6-gawk-5.1.0-man' from 'https://cache.nixos.org'...
copying path '/nix/store/8kn2pcf5p1jc528kmslskgbycxcmvf42-getconf-1003.1-2008' from 'https://cache.nixos.org'...
copying path '/nix/store/dd5988vwnirs66qf5wp8inn4ixma9rlv-gzip-1.10-man' from 'https://cache.nixos.org'...
copying path '/nix/store/5bv2p3cc06cfgc934cfpmvhgsvx60p41-libcap-2.48-man' from 'https://cache.nixos.org'...
copying path '/nix/store/9yk2k0j6xm1hq8rr651vlqx70nikqj94-libxslt-1.1.34' from 'https://cache.nixos.org'...
copying path '/nix/store/n4zsgk6bs4af95naymr00yx8nsrs828b-linux-pam-1.5.1-man' from 'https://cache.nixos.org'...
copying path '/nix/store/71wmig7469qvcqxfgnnazpgd3g4bnnrd-libxslt-1.1.34-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/9by2vb17x8q0cmqi3k4ryh6iwanvmrym-lndir-1.0.3' from 'https://cache.nixos.org'...
copying path '/nix/store/4vkjqbcaczn3qcmy64c8yk29s6537991-ncurses-6.2-man' from 'https://cache.nixos.org'...
copying path '/nix/store/zzjkdpgwwsc0yr5f6prz9kqgzrmd3ry1-shadow-4.8.1-man' from 'https://cache.nixos.org'...
copying path '/nix/store/1fdyxjsh9fsyiyv77giq21b9h5232hph-stdenv-linux' from 'https://cache.nixos.org'...
copying path '/nix/store/1hryqjd57545vry9ym8dzl43dmqf4lf4-util-linux-2.36.2-man' from 'https://cache.nixos.org'...
copying path '/nix/store/63mk52rhk47z705511x6fj7c6dvbih4g-xz-5.2.5-man' from 'https://cache.nixos.org'...
copying path '/nix/store/jdl9wrpvkfcjw7yj1430icbfm7csjx5v-zstd-1.4.9-man' from 'https://cache.nixos.org'...
building '/nix/store/70vn8sdp0vmkih8b6ankvfrgrrzcsqc3-builder.pl.drv'...
building '/nix/store/c2b2sm2qq8320w3nq75liyml13mrwy16-configuration.nix.drv'...
building '/nix/store/rgyxgl2piqnk3vnni9dvma1vssb11m3g-dbus-catalog.xml.drv'...
building '/nix/store/h2ca5yjzf69pvrpybbyx711dix1kdli8-etc-os-release.drv'...
building '/nix/store/mdyyq44dl6ylnn2kk1zxa18wkzsw3ycj-issue.drv'...
building '/nix/store/qjxd71i7nrbh15n419gslzsy5fcmgc01-nixos-21.05.3740.ce7a1190a0f.drv'...
building '/nix/store/qqqb2r0xy0kwkf20zq7g0nff3jw05rhy-nixos-version.drv'...
building '/nix/store/qn8iv33ys79rxvzymlmdn1s8j18pqwww-local-cmds.drv'...
building '/nix/store/yhkn5ifgvgyi5qqchxxf92sinryhgj0p-system-path.drv'...
collision between `/nix/store/ii06nl46nlpzar1zwrywhfwr4yzaj7av-nix-bash-completions-0.6.8/share/bash-completion/completions/nixos-container' and `/nix/store/xzp8yxv1m4i3n5ghiddvgv38q2aivbn6-nixos-container/share/bash-completion/completions/nixos-container'
created 1503 symlinks in user environment
building '/nix/store/fz5jdljbpibg0r6gln5qllqiaqrk12nc-stage-2-init.sh.drv'...
building '/nix/store/hxv4wpgb7lr1dx70pa9mvfzfv73zgaph-dbus-1.drv'...
building '/nix/store/r5w2f8sp18954mrr82va0f3mmrpv2nqv-unit-polkit.service.drv'...
building '/nix/store/rssbhl1j6fd93y2wwhviasv7acjgyfp5-unit-dbus.service.drv'...
building '/nix/store/y0dk0w3mnjswz07jkzsrvxkl08pk4pz5-unit-dbus.service.drv'...
building '/nix/store/bangdpmh3ckia8bkh33w79ljafa696bm-unit-systemd-fsck-.service.drv'...
building '/nix/store/73skknpbrxn3ma8x2z1hmilsz5xvxhc2-unit-systemd-vconsole-setup.service-disabled.drv'...
building '/nix/store/qn86bsazs92g5pldbbn0c60vc09qx8x2-user-units.drv'...
building '/nix/store/k04nljvj479pxcapckaqyrynni3k0k3p-system-units.drv'...
building '/nix/store/f2vy2kzjh8v445jdcfkkc8gz3j3m1gjw-etc.drv'...
building '/nix/store/wvgj75jm6nc3zkdn0ky2lfv8y0jd00wn-nixos-system-nixos-21.05.3740.ce7a1190a0f.drv'...
activating the configuration...
setting up /etc...
reloading user units for root...
setting up tmpfiles
reloading the following units: dbus.service
!-->
<pre></pre>
<pre>
setting up tmpfiles
reloading the following units: dbus.service
</pre>
</pre>
| https://github.com/NixOS/nixpkgs/issues/9735#issuecomment-783535726
| https://github.com/NixOS/nixpkgs/issues/9735#issuecomment-783535726
|-
| (optional) test changing the configuration of the NixOS container by installing a package (''ddate'') and disabling a (default running) service
|
|
: <code>nano /etc/nixos/configuration.nix</code>
<pre>
{
  imports = [ <nixpkgs/nixos/modules/virtualisation/lxc-container.nix> ];
</pre>
<pre></pre>
<pre>
services.openssh.enable = false;
</pre>
<pre></pre>
<pre>
  environment.systemPackages = with pkgs; [
    ddate
  ]; 
</pre>
<pre></pre>
<pre>
}
</pre>
: <code>nixos-rebuild switch</code>
<pre>
building Nix...
building the system configuration...
</pre>
<pre></pre>
<pre></pre>
: <code>ddate</code>
<pre>
</pre>
|-
|-
| …
| …
Return to "Proxmox Linux Container" page.