VirtualBox

Opened 17 years ago

Closed 15 years ago

#766 closed enhancement (wontfix)

Documentation/Manual changes for host interfaces/6.5

Reported by: Ben Owned by:
Component: documentation Version: VirtualBox 1.5.0
Keywords: documentation manual hostif Cc:
Guest type: other Host type: other

Description

I'd suggest two fixes for the current (as of this writing) UserManual, both apply to section 6.5:

The scripts should imo be changed to something similar to the examples below, because

  • /bin/bash as interpreter is unnecessary and a bad thing for anything but linux
  • using sudo to automate the privileged actions is probably superior to other hacks

TapUp script

#!/bin/sh

# Create an new TAP interface for the user .vbox. and remember its name.
interface=`sudo /opt/VirtualBox/VBoxTunctl -u virtualbox -b`

# If for some reason the interface could not be created, return 1 to
# tell this to VirtualBox.
if [ -z "$interface" ]; then
  exit 1
fi
# Write the name of the interface to the standard output.
echo $interface
# Bring up the interface.
sudo /sbin/ifconfig $interface up
# And add it to the bridge.
sudo /sbin/brctl addif br0 $interface

TapDown script

#!/bin/sh

# Remove the interface from the bridge. The second script parameter is
# the interface name.
echo "Removing interface $2"

sudo /sbin/brctl delif br0 $2
# And use VBoxTunctl to remove the interface.
sudo /opt/VirtualBox/VBoxTunctl -u virtualbox -d $2

Sudoers configuration file

# Permissions needed to create the vm interface
virtualbox      ALL=(ALL)       NOPASSWD: /opt/VirtualBox/VBoxTunctl -u virtualbox -b
virtualbox      ALL=(ALL)       NOPASSWD: /sbin/ifconfig tap? up
virtualbox      ALL=(ALL)       NOPASSWD: /sbin/ifconfig tap?? up
virtualbox      ALL=(ALL)       NOPASSWD: /sbin/brctl addif br0 tap?
virtualbox      ALL=(ALL)       NOPASSWD: /sbin/brctl addif br0 tap??

# Permissions needed to destroy the vm interface
virtualbox      ALL=(ALL)       NOPASSWD: /opt/VirtualBox/VBoxTunctl -u virtualbox -d tap?
virtualbox      ALL=(ALL)       NOPASSWD: /opt/VirtualBox/VBoxTunctl -u virtualbox -d tap??
virtualbox      ALL=(ALL)       NOPASSWD: /sbin/brctl delif br0 tap?
virtualbox      ALL=(ALL)       NOPASSWD: /sbin/brctl delif br0 tap??

Change History (2)

comment:1 by Frank Mehnert, 16 years ago

Component: otherdocumentation

comment:2 by Frank Mehnert, 15 years ago

Resolution: wontfix
Status: newclosed

Obsolete now since the hostif model was completely changed in VirtualBox 2.1.0.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use