File: distrobox-host-exec.md

package info (click to toggle)
distrobox 1.8.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,528 kB
  • sloc: sh: 5,992; makefile: 4
file content (63 lines) | stat: -rw-r--r-- 2,091 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!-- markdownlint-disable MD010 MD036 -->
# NAME

	distrobox-host-exec

# DESCRIPTION

distrobox-host-exec lets one execute command on the host, while inside of a container.

Under the hood, distrobox-host-exec uses `host-spawn` a project that lets us
execute commands back on the host.
If the tool is not found the user will be prompted to install it.

# SYNOPSIS

Just pass to "distrobox-host-exec" any command and all its arguments, if any.

	--help/-h:		show this message
	--verbose/-v:		show more verbosity
	--version/-V:		show version
	--yes/-Y:		Automatically answer yes to prompt:
                                host-spawn will be installed on the guest system
                                if host-spawn is not detected.
                                This behaviour is default when running in a non-interactive shell.

If no command is provided, it will execute "$SHELL".

Alternatively, you can symlink a command name to `distrobox-host-exec`
and then call that command by its name on the host, while inside of a container.

# EXAMPLES

## Run individual commands

	distrobox-host-exec ls
	distrobox-host-exec bash -l
	distrobox-host-exec flatpak run org.mozilla.firefox
	distrobox-host-exec podman ps -a

## Drop into host shell

	~$: distrobox-host-exec # No command, executes "$SHELL" on the host
	~$: distrobox-host-exec # This command now runs on the host
	You must run  distrobox-host-exec inside a container!

## Symlinking host commands

Use the host command name to create a symlink to `distrobox-host-exec`.
You can then call the host command from within the container.

	~$: git # We do not have git in the container
	bash: git: command not found
	~$: sudo ln -s /usr/bin/distrobox-host-exec /usr/local/bin/git
	~$: git version
	git version 2.51.1

You can control podman on the host from within the container as follows:

	~$: ln -s /usr/bin/distrobox-host-exec /usr/local/bin/podman
	~$: ls -l /usr/local/bin/podman
	lrwxrwxrwx. 1 root root 51 Jul 11 19:26 /usr/local/bin/podman -> /usr/bin/distrobox-host-exec
	~$: podman version
	...this is executed on host...