VirtualBox

Ticket #766 (closed enhancement: wontfix)

Opened 7 years ago

Last modified 5 years ago

Documentation/Manual changes for host interfaces/6.5

Reported by: blafasel Owned by:
Priority: minor 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

comment:1 Changed 6 years ago by frank

  • Component changed from other to documentation

comment:2 Changed 5 years ago by frank

  • Status changed from new to closed
  • Resolution set to wontfix

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

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use