Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in vmnet setup #2

Open
wackazong opened this issue Dec 20, 2023 · 2 comments
Open

Error in vmnet setup #2

wackazong opened this issue Dec 20, 2023 · 2 comments

Comments

@wackazong
Copy link
Contributor

Hey there, I think you built exactly what I need. Trying it out right now. I encountered one problem: the replacement sed command has trouble with my networks.yaml file. Still, the content of my networks.yaml seems fine.

socket_vmnet_path=$(readlink -f $(brew --prefix)/opt/socket_vmnet/bin/socket_vmnet | \
sed 's_/_\\/_g') && sed -i -re "s/^(  socketVMNet:).*/\1 \"$socket_vmnet_path\"/"  ${HOME}/.lima/_config/networks.yaml

sed: 1: "s/^(  socketVMNet:).*/\ ...": \1 not defined in the RE
$ cat ~/.lima/_config/networks.yaml 
# Path to socket_vmnet executable. Because socket_vmnet is invoked via sudo it should be
# installed where only root can modify/replace it. This means also none of the
# parent directories should be writable by the user.
#
# The varRun directory also must not be writable by the user because it will
# include the socket_vmnet pid file. Those will be terminated via sudo, so replacing
# the pid file would allow killing of arbitrary privileged processes. varRun
# however MUST be writable by the daemon user.
#
# None of the paths segments may be symlinks, why it has to be /private/var
# instead of /var etc.
paths:
# socketVMNet requires Lima >= 0.12 .
# socketVMNet has precedence over vdeVMNet.
  socketVMNet: "/opt/homebrew/Cellar/socket_vmnet/1.1.3/bin/socket_vmnet"
# vdeSwitch and vdeVMNet are DEPRECATED.
  vdeSwitch: /opt/vde/bin/vde_switch
  vdeVMNet: /opt/vde/bin/vde_vmnet
  varRun: /private/var/run/lima
  sudoers: /private/etc/sudoers.d/lima

group: everyone

networks:
  user-v2:
    mode: user-v2
    gateway: 192.168.104.1
    netmask: 255.255.255.0
    # user-v2 network is experimental network mode which supports all functionalities of default usernet network and also allows vm -> vm communication.
    # Doesn't support configuration of custom gateway; hardcoded to 192.168.5.0/24
  shared:
    mode: shared
    gateway: 192.168.105.1
    dhcpEnd: 192.168.105.254
    netmask: 255.255.255.0
  bridged:
    mode: bridged
    interface: en0
    # bridged mode doesn't have a gateway; dhcp is managed by outside network
  host:
    mode: host
    gateway: 192.168.106.1
    dhcpEnd: 192.168.106.254
    netmask: 255.255.255.0
@smbambling
Copy link
Owner

Hmmm....this might be an issue with the version of SED that is being called. My guess is you're using the MacOS default SED vs GNU SED. If you have brew I recommend installed GNU SED, but I'll see if I can make it work with both for the future.

@wackazong
Copy link
Contributor Author

Ok, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants