PC HP Zbook15 G3
ホスト Ubuntu22.04
Virtualbox 7.0(細かいバージョンは記録しなかった)
ゲスト Kubuntu22.04
先日、Ubuntu22.04だと画像をブラウザでアップロードする時等にサムネイル表示してくれないから不便だとして、代替手段としてインストールしたゲストのKubuntu、今日久しぶりに起動しようとしてみたら、起動しない。こんなメッセージを吐く。

ちなみに、おまけでインストールしたロシア謹製Astra Linuxも起動しない。
そこで、
$ sudo /sbin/vboxconfig
をしてみたのだが、結局、
ubu22@ubu22-HP-ZBook-15-G3:~$ sudo /sbin/vboxconfig
[sudo] ubu22 のパスワード:
vboxdrv.sh: Stopping VirtualBox services.
depmod: WARNING: could not open modules.order at /lib/modules/6.5.0-41-generic: No such file or directory
depmod: WARNING: could not open modules.builtin at /lib/modules/6.5.0-41-generic: No such file or directory
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong.
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root. If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.
「There were」以下全文をグーグル先生にて検索。
Qiita
@yfuna
kernel update後VirtualBoxが使えなくなった場合
最終更新日 2020年09月21日投稿日 2020年09月21日
I reinstalled Virtualbox and it workedsudo apt-get install --reinstall virtualbox
あー、やっぱりおとなしく仮想箱再インストールか。しかし、リポジトリの設定如何かもしれないけれど、手元の環境では、このコマンドを打つとカノニカル謹製仮想箱6がインストールされる。
ということでおとなしくオラ来るへ行ってvirtualbox-7.0_7.0.20-163906~Ubuntu~jammy_amd64.debをダウンロードし、ファイラーで右クリックして「別のアプリケーションで開く」→「ソフトウェアのインストール」でインストールした。
そうしたら、とりあえずゲストOSを起動できるようにはなった。
しかし、Guest Additionsのインストールができない。
仮想箱の仮想マシンウィンドウの「デバイス」→「Guest Additions のアップグレード...」はグレーアウトしていて、「Guest Additions CDの挿入…」をクリックすると

こういうエラーを吐く。で、ホストOSのローカルにはisoファイルがダウンロードされていない。
仕方がないので、まずホストOSにて、isoファイルを拾いに行く。URLがわからないので、指南してくれている人をグーグル先生にて探す。「virtualbox guestadditions インストール iso ダウンロード」で検索。
晴れのち曇り時々iPhone Android
VirtualBox Guest Additions単体でのインストール
2014年04月26日
うわ10年も前か。
さまざまな紹介サイトがあるので詳しいことは割愛しますが、
Ubuntu(ホストOS) Windows8.1(ゲストOS)の場合に、
「デバイス」メニューから「Guest Additions のインストール」の表示がされない場合があります。
そのため、単体で、Guest Additions をDLして、インストールする方法を紹介します。
http://download.virtualbox.org/virtualbox/
にアクセスして、欲しいバージョンからGuest AdditionsをDLします。
ということで、当該URLに行ってみた。

「VBoxGuestAdditions_7.0.20.iso 10-Jul-2024 19:51 52M」が該当なので、これをダウンロードする(Windowsも共通のisoファイルを使う)。
で、改めて、仮想箱の仮想マシンのウィンドウのメニューから、「デバイス」→「光学ドライブ」→「ディスクファイルを選択」として、さっきダウンロードした7.0.20.isoなファイルを「開く」すればいいはずなのだけれど、

先程の「挿入できません」のエラーメッセージを相変わらず吐く。そこで、「デバイス」→「光学ドライブ」→「ディスクイメージを選択/作成…」の方をクリックしてみて、

7.0.20.isoの方をクリックして「選択(H)」をクリックしても、相変わらずだめ。どうも、KubuntuのインストールDVDのisoイメージに食いついて放さないようだ。そこで、「デバイス」→「光学ドライブ」→「仮想ドライブからディスクを除去」で出てきたウィンドウ

で「強制マウント解除」をクリックしてから、ようやく、「デバイス」→「光学ドライブ」→「ディスクファイルを選択」ができるようになった。
なんかこれ、Kubuntuをインストールする時にも同じことやってたような…
で、マウントできましたが、

autorun.shを起動してみたら、gccとmakeとperlがない、とな。
で
# apt install gcc
ってするとですよ、
'Kubuntu 22.04.3 LTS _Jammy Jellyfish_ - Release amd64 (20230807.1)'
とラベルの付いたディスクをドライブ '/cdrom/' に入れて [Enter] キーを押してください
とラベルの付いたディスクをドライブ '/cdrom/' に入れて [Enter] キーを押してください
とな。なんでDVDを要求してくるんだよ、と思いつつも、さっきGuest Additions CDをマウントしたときの要領でインストールメディアをマウントしたけれども、変わらず。おいおい。グーグル先生で検索。「'Kubuntu 22.04.3 LTS _Jammy Jellyfish_ - Release amd64 (20230807.1)' とラベルの付いたディスクをドライブ '/cdrom/' に入れて [Enter] キーを押してください」
Hatena Blog
拡張チラシの裏
2010-01-17
apt-getしようとしたらCDを要求される
15年近く前の記事です。
原因は、/etc/apt/sources.list にdeb cdrom:[Debian GNU/Linux 5.0.3 _Lenny_ - Official i386 CD Binary-1 20090905-08:23]/ lenny mainのような一文があるからでしょう。コメントアウト!
そしたら、ネットワークからインストールできました。
まじかよ。あーあった。しかも先頭行。
deb cdrom:[Kubuntu 22.04.3 LTS _Jammy Jellyfish_ - Release amd64 (20230807.1)]/ jammy main multiverse restricted universe

改めて、
# apt install gcc
あー動いた動いた。

しかしまあ、この記事をKubuntuで書くに当たってスクリーンショット苦労したわ。まず、スクショ撮ろうとしてプリントスクリーンキーを押しても何も起こらず。スクショ撮るアプリが何かあったよな、と思ってKdeボタンクリックして「グラフィクス」を見ても出てこない。グーグル先生に「kde スクリーンショット」と質問すると
@IT
KDEでスクリーンショットを撮るには
北浦訓行
2002/4/25
2002/4/25
おーい22年前かい。そして、「KSnapshot」なんてのを、KDEのタスクバーの、マイクロソフトストアの紙袋みたいなアイコンクリックして探してみると、

spectacle…あーそんな名前だったけかな、replaces KSnapshotって書いてある。でもそれってインストールしてなかったっけ? まあいいや。で、「インストール」をクリックしてみたらですよ、pkexecみたいなのが立ち上がってきたのだけれど、んー、なんでspectacleが起動してそのpkexecみたいなウィンドウをキャプチャして保存するかどうするか訊いてきてんの??? とりあえずパスワード入力はキャンセルして、スクショ使えるようになった(その時のスクショ↓)

からいいんだけれど、WindowsとかGnomeみたいにaltキー押しながらだとアクティブウィンドウだけ、とか、shift押しながらだと範囲指定、とかじゃなくて面倒くさい。Spectacleの設定で予め、フルスクリーンか、アクティブウィンドウだけかを選んでおくようなんだけれども、いくらやってもフルスクリーン。なんだこれ、と思って「設定」をクリックすると、ああそういうことか、Windowsのプリンタドライバがよくやらかすやつ(ページ設定が、アプリの印刷ダイヤログボックスの設定とプリンタドライバの設定で矛盾している場合にどっちが優先されるかがぐちゃぐちゃ)と同じね。

「設定」で出てくるほうが「Take full screen screenshot」になってるといくらやってもだm…え゛っ゛??? 今度はこの「設定」を開いただけで、いくらやってもアクティブウィンドウしかキャプチャできなくなった。じゃあ上のスクショはどうやって撮ったのかというと、「設定」を開きながら、メインウィンドウの「撮影モード」をがちゃがちゃいじったらできるようになった。多分、「設定」の方の選択肢に、「use last-used caprute mode」などというのがあるのと、「設定」が開いているのにメインウィンドウの操作に抑制をかけていないからこういうことになるんじゃないかと思う(先般、とある計測器でそういう状態を起こしているものを発見したので直してもらった。計測器の電源が入っていないと、パラメータ設定ができないようにメニュー画面にロックをかけているんだけれど、計測器の電源が入っている間にパラメータ設定画面を開くと、その状態で計測器の電源を落とすとパラメータ設定画面が再ロックされずに編集できるままの状態で残され、しかし、デタラメな信号が入力されるからチャネル配置がめちゃくちゃになり、しかもそのめちゃくちゃなチャネル配置のまま設定ファイルの上書き保存ができちゃう)。
くっそなんでGuest Additions CDのシェルスクリプトが走らないのを直すのにこんなあっちこっち寄り道してるんだ?
よーし、gcc、make、perlのインストールが終わった。あらためて、autorun.shを起動。

おー、動いた動いた(途中からのスクショだけど)。テキストは次のとおり。
Verifying archive integrity... 100% MD5 checksums are OK. All good.
Uncompressing VirtualBox 7.0.20 Guest Additions for Linux 100%
VirtualBox Guest Additions installer
Removing installed version 7.0.20 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Setting up modules
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 quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 6.2.0-36-generic.
update-initramfs: Generating /boot/initrd.img-6.2.0-36-generic
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted or 'rcvboxadd reload' triggered
VirtualBox Guest Additions: reloading kernel modules and services
VirtualBox Guest Additions: user-land services were not started
VirtualBox Guest Additions: kernel modules and services were not reloaded
The log file /var/log/vboxadd-setup.log may contain further information.
Press Return to close this window...
Uncompressing VirtualBox 7.0.20 Guest Additions for Linux 100%
VirtualBox Guest Additions installer
Removing installed version 7.0.20 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Setting up modules
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 quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 6.2.0-36-generic.
update-initramfs: Generating /boot/initrd.img-6.2.0-36-generic
VirtualBox Guest Additions: Running kernel modules will not be replaced until
the system is restarted or 'rcvboxadd reload' triggered
VirtualBox Guest Additions: reloading kernel modules and services
VirtualBox Guest Additions: user-land services were not started
VirtualBox Guest Additions: kernel modules and services were not reloaded
The log file /var/log/vboxadd-setup.log may contain further information.
Press Return to close this window...