LoginSignup
0
0

More than 5 years have passed since last update.

Ubuntu の VirtualBox Server にコマンドラインで hostonly interface を加える

Posted at

VirtualBox Server に CUI で hostonly interface を加える

環境

  • Ubuntu 18.04
  • VirtualBox 5.2.22r126460

さっそく追加してみる

$ VBoxManage list hostonlyifs
(全部消しているので何も出ない)
$ VBoxManage hostonlyif create
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interface 'vboxnet0' was successfully created
$ VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1
$ VBoxManage dhcpserver add --ifname vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0 --lowerip 192.168.56.100 --upperip 192.168.56.200
$ VBoxManage dhcpserver modify --ifname vboxnet0 --enable

考え方

hostonly interface には dhcpserver は 付属しない ので別々に建てて組み合わせるということみたいです。

できているか検証

  • hostonlyifs の DHCP は Disabled でただしい です。
$ VBoxManage list dhcpservers
NetworkName:    HostInterfaceNetworking-vboxnet0
IP:             192.168.56.1
NetworkMask:    255.255.255.0
lowerIPAddress: 192.168.56.100
upperIPAddress: 192.168.56.200
Enabled:        Yes
$ VBoxManage list hostonlyifs
Name:            vboxnet0
GUID:            786f6276-656e-4074-8000-0a0027000000
DHCP:            Disabled
IPAddress:       192.168.56.1
NetworkMask:     255.255.255.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Wireless:        No
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-vboxnet0

おまけ: CUI で クリップボードの共有双方向 にする

  • GUI でいうところのどこかというと赤枠で囲っている部分です

vbox_clipboard.png

  1. VirtualBox を動かしているユーザーに切り替えてください、例えば vbox ユーザーであれば

    $ sudo vbox
    
  2. 現在の vm 一覧から、例では A_VM に対しクリップボードの共有を双方向にします

    $ VBoxManage list vms
    "A_VM" {51e22b07-a72a-4624-94f8-7b8c75222e8d}
    "B_VM" {666afa45-e0f1-4d62-ad87-2332dfc7e108}
    $ VBoxManage modifyvm "A_VM" --clipboard bidirectional
    
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0