Skip to content

Capstan fails to connect to started VM when sock path is too long on VirtualBox #71

@wkozaczuk

Description

@wkozaczuk

When instance name is pretty long resulting file path length of the sock file is longer than 104 limit (golang/go#6895) and results in the error like this:

capstan run -c 4 -v -p vbox -f "10000:10000" remote_loader_without_console2
Removing orphaned instance folder:
....
Empty command line will be set for this image
Created instance: remote_loader_without_console2

dial unix <long_path.sock>: connect: invalid argument

This method in hypervisor/vbox/vbox.go and hypervisor/vmv/vmw.go:

func (c *VMConfig) sockPath() string {
	if runtime.GOOS == "windows" {
		return "\\\\.\\pipe\\" + c.Name
	} else {
		return filepath.Join(c.Dir, c.Name, fmt.Sprintf("%s.sock", c.Name))
	}
}

needs to be changed to return path that is shorter than 104.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions