virt-login-shell(1)
β¨ NAME β¨
virt-login-shell β bestie, it's a tool that drops you into a shell inside a container π«Ά
okay so real talk, this is virt-login-shell(1) from the Virtualization Support collection and she is lowkey iconic. let's get into it π
πΈ SYNOPSIS πΈ
virt-login-shell [OPTION]
π¦ DESCRIPTION π¦
So virt-login-shell is a setuid shell β which is giving very much "trust me bro, I got privileges" energy β and what she does is let you join an LXC container that matches your username. And if that container isn't running? bestie she will attempt to start it for you. main character behavior fr fr β¨
π¨ NOT ALLOWED FOR ROOT. virt-login-shell cannot be run by root. periodt. that's not a suggestion, that's the rules.
For us normal little users: you get added to a container matching your username β if it exists β and if you're configured in /etc/libvirt/virt-login-shell.conf. two vibes, both required π
The basic structure of most virt-login-shell usage is literally just:
virt-login-shell
that's it. that's the whole vibe check π
π OPTIONS π
-c CMDβ tells the shell to runCMDinstead of giving you an interactive prompt. like, do the thing and dip πβοΈ-h,--helpβ shows you the command line help usage, then exits. self care π-V,--versionβ shows version info, then exits. know your queen's era π«Ά
π§ CONFIG π§
By default, virt-login-shell will execute the /bin/sh program for the user. but bestie, you can change that whole situation by defining the shell variable in /etc/libvirt/virt-login-shell.conf. like so:
shell = [ "/bin/bash" ]
Now β if the auto_shell config option is set, she'll attempt to automatically detect the shell from /etc/password inside the container. π
β οΈ but only do this if the container has a separate/etcdirectory from the host, otherwise it will end up recursively invokingvirt-login-shellβ which is a whole infinite loop situation, absolutely not the vibe. π
auto_shell = 1
And by default, no users are allowed to use virt-login-shell. rude, I know. so if you want to let certain users in, you need to modify the allowed_users variable in /etc/libvirt/virt-login-shell.conf. example:
allowed_users = [ "tom", "dick", "harry" ]
the squad. the crew. the guest list πβ¨
π EXIT STATUS π
Normally, virt-login-shell returns the exit status of the command it executed. and if the command was killed by a signal, but that signal is not fatal to virt-login-shell, then she returns the signal number plus 128. math girlie π
And here's the exit statuses generated by virt-login-shell itself:
0β An option was used to learn more about this binary. (a curious queen, respect π«Ά)125β Generic error before attempting execution of the configured shell; for example, iflibvirtdis not running. π126β The configured shell exists but could not be executed. so close, and yetβ¦127β The configured shell could not be found. she's not here, bestie. gone. π
π BUGS π
Please report all bugs you discover. π and you've got options, babes:
- the mailing list
<https://libvirt.org/contact.html>
- the bug tracker
<https://libvirt.org/bugs.html>
Alternatively, you may report bugs to your software distributor / vendor. they got you π«Ά
π AUTHOR π
Daniel Walsh β shoutout to the legend π
π COPYRIGHT π
Copyright (C) 2013-2014 Red Hat, Inc., and the authors listed in the libvirt AUTHORS file.
π LICENSE π
virt-login-shell is distributed under the terms of the GNU LGPL v2+.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. no safety net, bestie, you're on your own and that's just the truth π
β SEE ALSO β
virsh(1), <https://libvirt.org/>
and that's the whole page, bestie!! this was virt-login-shell(1) from Virtualization Support, and yeah the footer's just the page name again so here's the sign-off β go forth and container responsibly π¦β¨π
π¦ where this page comes from
- nixpkgs unstable: libvirt 12.8.0
- ubuntu stonking: libvirt-login-shell 12.6.0-1ubuntu4
- ubuntu stonking: libvirt-login-shell-hwe 12.6.0-1ubuntu4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms