はじめに
特別な設定をしないとMacとvirtualbox上のubutnuとでクリップボードの共有ができない。
ネット上の情報は錯綜しており、解決に時間がかかったため、記事にすることにした。
環境
machine: MakBook Pro(13-inch, 2016) CPU: 2.9GHz dual core, Intel Core i5 OS: macOS Monterey(version 12.6.7) VirtualBox: version 7.0.8 r156879 Ubuntu: version 22.04.2 LTS (Jammy Jellyfish)
方法
以下の記事の通りにする。要約すると、「Guest Additions というソフトをインストール」するということである。
(閲覧日2023/07/23, 記事作成日2022/3/17【備忘録】Virtual Box で Ubuntu 20.04LTSの共有フォルダ/クリップボード共有を有効化 | Inno-Tech-Life, https://inno-tech-life.com/dev/infra/vm_ubuntu_guest_additions/)
・virtualbox上でubuntuを立ち上げておく。
・virtualboxのメニューバー(アプリケーションメニュー) > Devises > Insert Guest CD Image を選択。するとubuntuのDockにCDのアイコンが表示される。
・以下のコマンドを実行。VBox_GAs_[virsion]のvirsionにはVirtualboxのバージョンが入る。不明な時は、Dockに表示されたCDのアイコンをクリックすると、ウィンドウのタイトルにVBox_GAs_7.0.8
などと表示されることから知ることができる。
# update packages sudo apt update sudo apt upgrade -y # Install packages required to install Guest Additions sudo apt install linux-headers-generic build-essential # Go to the directory (`whoami` will contain your user name) cd /media/`whoami`/VBox_GAs_[virsion] # execute install sudo ./VBoxLinuxAdditions.run # reboot sudo reboot
・Dock > CD で右クリックしてCDを取り出す。
・Oracle VM VirtualBox マネージャー > 設定 > 高度 > クリップボードの共有で「双方向」にする。
問題点
インストール直後、画面がちらつき、どんどん画面が縮小されていく。
画面を拡大しているのが原因のようであった。画面は拡大率220%まではカクツキが生じなかった。230%では生じた。
Translated with DeepL
Introduction
I cannot share the clipboard between my Mac and ubutnu on virtualbox without special settings.
Information on the net is mixed, and it took me a long time to solve the problem, so I decided to write an article about it.
Environment
machine: MakBook Pro (13-inch, 2016) CPU: 2.9GHz dual core, Intel Core i5 OS: macOS Monterey(version 12.6.7) VirtualBox: version 7.0.8 r156879 Ubuntu: version 22.04.2 LTS (Jammy Jellyfish)
Methods
Follow the instructions in the article below. In summary, install the "Guest Additions" software.
(viewed on 2023/07/23, article created on 2022/3/17 [memorandum] Enabling Ubuntu 20.04LTS shared folder/clipboard sharing on Virtual Box | Inno-Tech-Life, https://inno-tech-life.com/dev/ (infra/vm_ubuntu_guest_additions/)
Launch ubuntu on virtualbox.
Select "Devises > Insert Guest CD Image" from the virtualbox menu bar (application menu). Then the CD icon will appear in the Dock of ubuntu.
Execute the following command: VBox_GAs_[virsion] where virsion is the version of Virtualbox. If you are unsure of the version, click the CD icon displayed in the Dock, and you will see VBox_GAs_7.0.8
in the title of the window.
・Right-click in the Dock > CD and eject the CD.
▪ Oracle VM VirtualBox Manager > Settings > Advanced > Clipboard Sharing to "bi-directional".
Problems
Immediately after installation, the screen flickered and shrunk rapidly.
The cause seemed to be that the screen was enlarged. The screen did not show any crackling up to 220% magnification, but it did at 230%.