Proxmox Linux Container: Difference between revisions

imported>Illustris
No edit summary
Nani8ot (talk | contribs)
Add note to only run /run/current-system/activate when no commands can be found, e.g. ls.
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Warning|This page is out of date. See [[Proxmox]] for instructions that apply to more recent versions of nixpkgs and proxmox.}}
{{outdated|See [[Proxmox]] for instructions that apply to more recent versions of nixpkgs and proxmox.}}


= Building Proxmox Linux Containers with Nix =
= Building Proxmox Linux Containers with Nix =
Line 8: Line 8:


With a small amount of work, it is possible to use NixOS as a LXC container under Proxmox.
With a small amount of work, it is possible to use NixOS as a LXC container under Proxmox.
== Generate a container tarball ==
A better way to deploy a NixOS container tarball on Proxmox is described at [[Proxmox Virtual Environment#LXC]].


== Finding a container tarball ==
== Finding a container tarball ==
Line 61: Line 64:


To create a new NixOS container, you can then clone the template instead of doing the preceding steps.
To create a new NixOS container, you can then clone the template instead of doing the preceding steps.
== Expected issues ==
=== Entering the container by <code>pct enter</code> ===
enter a (nixos) container from the proxmox host
: <syntaxhighlight lang="shell">[root@proxmox:~]# pct enter <vmid></syntaxhighlight>
: <syntaxhighlight lang="shell">sh-5.2#</syntaxhighlight>


== Expected issues ==
: <s>set (missing) environment variables</s>
:: <s><syntaxhighlight lang="shell">sh-5.2# source /etc/set-environment</syntaxhighlight></s>
:: <s><syntaxhighlight lang="shell">sh-5.2#</syntaxhighlight></s>
or
: set (missing) environment variables with <code>[[wikipedia:en:dot (command)#source|.]]</code>
:: <syntaxhighlight lang="shell">sh-5.2# . /etc/profile</syntaxhighlight>
:: <syntaxhighlight lang="bash">[root@nixos:~]#</syntaxhighlight>
If commands (like ls) still can't be found, try running:
:: <syntaxhighlight lang="shell">
[root@nixos:~] /run/current-system/activate
</syntaxhighlight>
<!--
or
: set (missing) environment variables by opening a new shell
:: <syntaxhighlight lang="shell">sh-5.2# sh -l</syntaxhighlight>
:: <syntaxhighlight lang="bash">[root@nixos:~]#</syntaxhighlight>
-->


=== nixos-rebuild switch ===
=== nixos-rebuild switch ===
Line 86: Line 111:
=== Black Console in Proxmox ===
=== Black Console in Proxmox ===


The Proxmox console may appear black when launched. It is at the login prompt but no existing text is rendered. Just type "root" and hit enter and new text will get rendered just fine.
The Proxmox console may appear black when launched. It is at the login prompt but no existing text is rendered. Just type "root" and hit enter and new text will get rendered just fine. If you are still unable to get the console to render, you can try changing the console to `/dev/console` instead of the standard tty.