Proxmox: Difference between revisions

From Alpine Linux
(added necessary context fixed and added links and categories)
m (removed line numbers)
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
== Using agetty in proxmox ==
== Using agetty in proxmox ==


Proxmox v8.3.2 host has a setup_init script for Alpine linux at {{path|/usr/share/perl5/PVE/LXC/Setup/Alpine.pm}} that overwrites all changes to tty lines in {{path|/etc/inittab}}. So, the instructions given in [[TTY Autologin#By_using_agetty|TTY Autologin]] page does not work. 
Instructions given in [[TTY Autologin#By_using_agetty|TTY Autologin]] page does not work in Proxmox v8.3.2 host, as the host has a setup_init script for Alpine linux at {{path|/usr/share/perl5/PVE/LXC/Setup/Alpine.pm}} that overwrites all changes to tty lines in {{path|/etc/inittab}}.  


Modify the script at {{path|/usr/share/perl5/PVE/LXC/Setup/Alpine.pm}} and add the following lines in setup_init so as not to modify the {{path|/etc/inittab}} file if it contains the word "agetty" as follows {{Cat|/usr/share/perl5/PVE/LXC/Setup/Alpine.pm|<nowiki>...
Modify the script at {{path|/usr/share/perl5/PVE/LXC/Setup/Alpine.pm}} and add the following lines in setup_init so as not to modify the {{path|/etc/inittab}} file if it contains the word "agetty" as follows {{Cat|/usr/share/perl5/PVE/LXC/Setup/Alpine.pm|<nowiki>...
Line 9: Line 9:
my $inittab = $self->ct_file_get_contents($filename);
my $inittab = $self->ct_file_get_contents($filename);
--->
--->
56:  if ($inittab =~ /agetty/) {
  if ($inittab =~ /agetty/) {
57:        return;
        return;
58:    }
    }
<----
<----
my @lines = grep {
my @lines = grep {
Line 17: Line 17:
</nowiki>}}
</nowiki>}}


After running the LXC container, [[Install]] the {{pkg|agetty}} package as above and modify this line in {{path|/etc/inittab}}
After running the LXC container, [[Install]] the {{pkg|agetty}} package and modify this line in {{path|/etc/inittab}} file as follows {{Cat|/etc/inittab|...
<pre>
tty1::respawn:/sbin/agetty --autologin root --noclear 38400 tty1
tty1::respawn:/sbin/agetty --autologin root --noclear 38400 tty1
</pre>
...
 
}}
After a reboot the container will perform an autologin.
After a reboot the container will perform an autologin.



Latest revision as of 15:33, 13 March 2025

This page documents instructions related to running Alpine Linux with Proxmox Virtual Environment.

Using agetty in proxmox

Instructions given in TTY Autologin page does not work in Proxmox v8.3.2 host, as the host has a setup_init script for Alpine linux at /usr/share/perl5/PVE/LXC/Setup/Alpine.pm that overwrites all changes to tty lines in /etc/inittab.

Modify the script at /usr/share/perl5/PVE/LXC/Setup/Alpine.pm and add the following lines in setup_init so as not to modify the /etc/inittab file if it contains the word "agetty" as follows

Contents of /usr/share/perl5/PVE/LXC/Setup/Alpine.pm

... ... my $inittab = $self->ct_file_get_contents($filename); ---> if ($inittab =~ /agetty/) { return; } <---- my @lines = grep { ...

After running the LXC container, Install the agetty package and modify this line in /etc/inittab file as follows

Contents of /etc/inittab

... tty1::respawn:/sbin/agetty --autologin root --noclear 38400 tty1 ...

After a reboot the container will perform an autologin.

See also