総数:13 今日:1 昨日:0

もくじ

参考url
Rocky on VirtualBox
ゲストOS に「VirtualBox Guest Additions」をインストール

virtualbox のインストール

installing virtualbox on ubuntu desktop 22.04.2

2023/07/29
バージョン 7.0.10 r158379 (Qt5.15.3)

空の仮想マシンを作成する

rocky 8.10 のダウンロード

https://ftp.iij.ad.jp/pub/linux/rocky/8/isos/x86_64/ からダウンロードする。

https://ftp.iij.ad.jp/pub/linux/rocky/8/isos/x86_64/Rocky-8.10-x86_64-dvd1.iso

virtual boxを起動する。

Dockの アプリケーションを表示する の virtualbox用ショートカットをクリックする。

仮想マシンー新規 を選択する。

仮想マシンの作成 画面での設定手順

エキスパートモードをクリックする。

Name and Operating System 画面での設定手順

設定項目設定内容
名前ubdt2204vbox0
Folder/home/<username>/VirtualBox VMs
ISO Image未選択状態
タイプLinux
バージョンUbuntu 22.04 LTS (Jammy Jellyfish)(64-bit)

Unattended Guest OS Install Setupの画面での設定手順

グレーアウトされており設定操作不可

Hardware の画面での設定手順

設定項目設定内容
メインメモリー5120 MB
Processors3 CPU

Hard Disk の画面での設定手順

設定項目設定内容
Create a Virtual Hard Disk Now ラジオボタン選択する
Hard Disk File Location/home/<username>/VirtualBox VMs/ubdt2204vbox0/ubdt2204vbox0.vdi
Disk Size128 GB
Pre-allocate Full Sizeチェックする

完了 を選択する。

空の仮想マシンを設定する

Oracle VM VirtualBox マネージャー 画面で空の仮想マシンを選択した状態にする。

設定 を選択する。

一般 での設定手順

システム での設定手順

ストレージ での設定手順

コントローラ:IDE のところの 空 光ディスク のアイコンを選択する。

右側の 光学ドライブ IDEセカンダリマスター のすぐ右にある 光ディスク のアイコンを選択する。

仮想光学ディスクファイルを選択... を選択する。

さきほどダウンロードした ubuntu-22.04.2-desktop-amd64.iso をファイル選択する。

ネットワーク での設定手順

共有フォルダー での設定手順

右端にある 新規共有フォルダーの追加 アイコンを選択

共有フォルダーの追加 画面での設定手順

設定項目設定内容
フォルダーのパスVM側のディレクトリ名を指定 例)~/shared_with_guests
フォルダー名VM側のディレクトリ名を指定 例)shared_with_host
マウントポイント空白
自動マウントチェック状態 にする。

ubdt2204vbox0 - 設定 画面 右下の OK を選択する。

ubuntu desktop 22.04.2 のインストール

Oracle VM VirtualBox マネージャー 画面で空の仮想マシンを選択した状態にする。

起動 を選択する。

ubdt2004[実行中]Oracle VM VirtualBox 画面での設定手順

Welcome 画面で

キーボードレイアウト 画面で

アップデートと他のソフトウェア 画面で、

インストールの種類 画面で、

ディスクに変更を書き込みますか? 画面で、続ける を選択する。

どこに住んでますか? 画面で下記を指定する。

Tokyo

キーボードレイアウト 画面で、

あなたの情報を入力してください 画面で、

あなたの名前:
例 コンピューターの名前: ubdt2204vbox0
ユーザー名の入力: <''username''>
パスワードの入力: ''password''
パスワードの確認: ''password''

インストールが完了しました 画面で、

黒画面が表示された状態(Please remove installation medium,then reboot. と表示された状態)にて

ログイン画面 で、

Guest Additions CD の適用

ログイン直後のデスクトップ画面が表示された状態 にて

デバイス メニュー項目を選択

Guest Additions CD イメージの挿入… を選択

ゲストOS のファイルマネージャで、CD イメージを開きます

ファイルマネージャの空きで右クリック→「端末で開く」

スクリプトの実行

$ pwd
/media/<username>/VBox_GAs_7.0.10   ←(自動マウント時の位置)
$ sudo ./VBoxLinuxAdditions.run
[sudo] パスワード: 
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.14 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:   /sbin/rcvboxadd quic-rw-rw-r--  1 ryu ryu 14213840896  5月 24 13:28 Rocky-8.10-x86_64-dvd1.isoksetup all
VirtualBox Guest Additions: Building the modules for kernel 5.0.0-23-generic.

This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
Press Return to close this window...

terminal画面にて

$ sudo apt update
$ sudo apt upgrade

再起動する。

terminal画面にて

$ sudo apt install gcc make perl

再度挑戦!

Guest Additions CD イメージの挿入… を選択

ゲストOS のファイルマネージャで、CD イメージを開きます

ファイルマネージャの空きで右クリック→「端末で開く」

再度スクリプトの実行

$ pwd
/media/<username>/VBox_GAs_7.0.10   ←(自動マウント時の位置)
$ sudo ./VBoxLinuxAdditions.run
[sudo] パスワード: 
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.14 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.0.14 of VirtualBox Guest A-rw-rw-r--  1 ryu ryu 14213840896  5月 24 13:28 Rocky-8.10-x86_64-dvd1.isodditions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or[[Memorandums]]
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 5.0.0-23-generic.
update-initramfs: Generating /boot/initrd.img-5.0.0-23-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
Press Return to close this window...

Enter キーを押下する。

再起動する。

共有フォルダの確認

存在を確認

~$ ls -la /media/
合計 16
drwxr-xr-x   4 root root   4096  7月 31 16:54 .
drwxr-xr-x  20 root root   4096  7月 31 14:01 ..
drwxr-x---+  2 root root   4096  7月 31 20:02 ryu
drwxrwx---   1 root vboxsf 4096  7月 30 15:08 sf_shared_with_host

vboxsf グループへの参加

ユーザ<username>の所属グループを確認

~$ groups <username>
<username> : <username> adm cdrom sudo dip plugdev lpadmin sambashare

ユーザ <username> をグループ vboxsf に追加する

~$ sudo gpasswd -a <username> vboxsf
ユーザ <username> をグループ vboxsf に追加

ユーザ <username> の所属グループを再度確認

~$ groups <username>
<username> : <username> adm cdrom sudo dip plugdev lpadmin sambashare vboxsf

トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS