Skip to content

Commit 258ff95

Browse files
authored
Merge pull request #2790 from jandubois/guestagent-debug
Pass limactl start --debug flag to guest agent
2 parents cd4cc76 + f26b12d commit 258ff95

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/25-guestagent-base.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ name="lima-guestagent"
3535
description="Forward ports to the lima-hostagent"
3636
3737
command=${LIMA_CIDATA_GUEST_INSTALL_PREFIX}/bin/lima-guestagent
38-
command_args="daemon --vsock-port \"${LIMA_CIDATA_VSOCK_PORT}\" --virtio-port \"${LIMA_CIDATA_VIRTIO_PORT}\""
38+
command_args="daemon --debug=${LIMA_CIDATA_DEBUG} --vsock-port \"${LIMA_CIDATA_VSOCK_PORT}\" --virtio-port \"${LIMA_CIDATA_VIRTIO_PORT}\""
3939
command_background=true
4040
pidfile="/run/lima-guestagent.pid"
4141
EOF

pkg/cidata/cidata.TEMPLATE.d/lima.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
LIMA_CIDATA_DEBUG={{ .Debug }}
12
LIMA_CIDATA_NAME={{ .Name }}
23
LIMA_CIDATA_USER={{ .User }}
34
LIMA_CIDATA_UID={{ .UID }}

pkg/cidata/cidata.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"time"
1717

1818
"github.com/docker/go-units"
19+
"github.com/lima-vm/lima/pkg/debugutil"
1920
"github.com/lima-vm/lima/pkg/iso9660util"
2021
"github.com/lima-vm/lima/pkg/limayaml"
2122
"github.com/lima-vm/lima/pkg/localpathutil"
@@ -124,6 +125,7 @@ func templateArgs(bootScripts bool, instDir, name string, instConfig *limayaml.L
124125
return nil, err
125126
}
126127
args := TemplateArgs{
128+
Debug: debugutil.Debug,
127129
BootScripts: bootScripts,
128130
Name: name,
129131
User: u.Username,

pkg/cidata/template.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ type Disk struct {
5454
FSArgs []string
5555
}
5656
type TemplateArgs struct {
57+
Debug bool
5758
Name string // instance name
5859
IID string // instance id
5960
User string // user name

website/content/en/docs/dev/internals/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ Max file name length = 30
174174
The volume label is "cidata", as defined by [cloud-init NoCloud](https://docs.cloud-init.io/en/latest/reference/datasources/nocloud.html).
175175

176176
### Environment variables
177+
- `LIMA_CIDATA_DEBUG`: the value of the `--debug` flag of the `limactl start` command.
177178
- `LIMA_CIDATA_NAME`: the lima instance name
178179
- `LIMA_CIDATA_MNT`: the mount point of the disk. `/mnt/lima-cidata`.
179180
- `LIMA_CIDATA_USER`: the username string

0 commit comments

Comments
 (0)