Virtual BoxにインストールしたUbuntuにホストOSからSSHでつなぐ。
ホストOSでの操作 Virtual Boxの設定 環境設定 > ネットワーク > ホストオンリーネットワーク > 右の+アイコン vboxnet0とかいうのが生まれるはず。(すでにある場合はいらない)
仮想マシンの設定 設定 > ネットワーク > アダプタ2 ネットワークアダプタの有効化にチェックを入れる。 割り当て:ホストオンリーアダプタ 名前:vboxnet0
設定ファイルを編集:
# vi /etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet dhcp #### ここから新規追加 ##### auto eth1 iface eth1 inet static address 192.168.56.101 gateway 192.168.56.1 netmask 255.255.255.0
再起動と確認:
# /etc/init.d/networking restart # ifconfig
eth1の項目の中に inet addr:192.168.56.101 とか出てくれば成功。
終わり。