いろいろやってみるにっき

てきとーに生きている奴の日記

古いエントリのサムネイル画像がリンク切れになってたりするけど、チマチマ修正中


Ubuntu22.04でUnity Hubを動かそうと思ったら動かなかった(進行中)

こんなツイートが流れてきた。

 

どんな環境か分からないけど、WindowsVS Codeなんてインストーラをダウンロードして実行するだけなので「Visual Studioをインストールさせるのは、かなり苦労」という状況を考えにくい。Unityは触ったことなかったけど、Windowsではすぐに動いた。マシン時間は掛かったけど。すげえ容量食った。残りディスク見てすぐアンインストールしたw

 

そこで、ChromebookLinuxあるいはMacなのだろうと仮定する。Windowsだけど容量少ないって可能性も無くはないけど、それなら空き容量増やせって話だし、大学とかだと毎年春に話題になる生協PCだったりするので今どきのPCはディスク容量はありそう。

shigeo-t.hatenablog.com

 

そこでまず、Ubuntu22.04で試してみてうまくいったらChromeOS Flexでやってみることに。

 

なんでUbuntu22.04かというとすぐに起動できるUbuntuVMが22.04と18.04だからで、VMware Workstation Playerの上にあったから。あと、ChromeOS FlexLinuxバージョンはDebian 11でDebian相当のUbuntuバージョンがすぐ動く中では22.04というのもある。

 

しかし、Unityの動作要件を見るとUbuntu18.04までになっている。

unity.com

Unity Hub のシステム要件
OS:Windows 7 SP1 以降、8、10(64 ビットバージョンのみ)、Mac OS X 10.12 以降、Ubuntu 16.04、18.04、CentOS 7。

GPU:DX10(シェーダーモデル 4.0)の性能を持つグラフィックスカード。

 

グラフィックスカード?何それということで、その2つを無視してインストールを進めてみる。

 

ところで、Linuxダウンロードをクリックすると、コマンドが並んでいる。これなら「UnityとVisual Studioをインストールさせるのは、かなり苦労しますね。」はわかる。

docs.unity3d.com

Debian or Ubuntu
Installing:
To install the Unity Hub on a Debian or Ubuntu Linux distribution, you need to add the Unity Hub Debian repository along with the public signing key to verify the integrity of the packages.

To add the Unity Hub repository, you need an entry in /etc/apt/sources.list.

Run the following command to add the Unity Hub repository:

$ sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
To add the public signing key, run the following command:

$ wget -qO - https://hub.unity3d.com/linux/keys/public | sudo apt-key add -
Then update the package cache and install the package using:

$ sudo apt update
$ sudo apt-get install unityhub
Uninstalling the Hub:
To remove the Unity Hub from the system, run the following command:

$ sudo apt-get remove unityhub

 

実行してみる。

shigeo@shigeo-virtual-machine:~$ sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
[sudo] shigeo のパスワード: 
shigeo@shigeo-virtual-machine:~$ wget -qO - https://hub.unity3d.com/linux/keys/public | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
shigeo@shigeo-virtual-machine:~$ sudo apt update -y
ヒット:1 http://archive.ubuntulinux.jp/ubuntu jammy InRelease                                                                 
ヒット:2 http://archive.ubuntulinux.jp/ubuntu-ja-non-free jammy InRelease                                                     
ヒット:3 http://nginx.org/packages/ubuntu precise InRelease                                                                   
取得:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]                                                    
ヒット:5 http://jp.archive.ubuntu.com/ubuntu jammy InRelease                                                                  
ヒット:6 http://jp.archive.ubuntu.com/ubuntu jammy-updates InRelease                                                          
ヒット:7 http://jp.archive.ubuntu.com/ubuntu jammy-backports InRelease                                                        
ヒット:8 https://brave-browser-apt-release.s3.brave.com stable InRelease                                                      
取得:10 http://security.ubuntu.com/ubuntu jammy-security/main amd64 DEP-11 Metadata [20.1 kB]                                 
取得:9 https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local stable InRelease [2,739 B]                
取得:11 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 DEP-11 Metadata [13.3 kB]
取得:12 https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local stable/main amd64 Packages [1,141 B]
148 kB を 3秒 で取得しました (47.1 kB/s)
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了
状態情報を読み取っています... 完了        
アップグレードできるパッケージが 7 個あります。表示するには 'apt list --upgradable' を実行してください。
W: http://nginx.org/packages/ubuntu/dists/precise/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://hub.unity3d.com/linux/repos/deb/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
shigeo@shigeo-virtual-machine:~$ sudo apt-get install unityhub
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了        
状態情報を読み取っています... 完了        
以下のパッケージが新たにインストールされます:
  unityhub
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 7 個。
131 MB のアーカイブを取得する必要があります。
この操作後に追加で 407 MB のディスク容量が消費されます。
取得:1 https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local stable/main amd64 unityhub amd64 3.3.0 [131 MB]
131 MB を 14秒 で取得しました (9,358 kB/s)                                                                                    
以前に未選択のパッケージ unityhub を選択しています。
(データベースを読み込んでいます ... 現在 211725 個のファイルとディレクトリがインストールされています。)
.../unityhub_3.3.0_amd64.deb を展開する準備をしています ...
unityhub (3.3.0) を展開しています...
unityhub (3.3.0) を設定しています ...
chmod: '/opt/unityhub/chrome-sandbox' にアクセスできません: そのようなファイルやディレクトリはありません
desktop-file-utils (0.26-1ubuntu3) のトリガを処理しています ...
hicolor-icon-theme (0.17-2) のトリガを処理しています ...
gnome-menus (3.36.0-1ubuntu3) のトリガを処理しています ...
mailcap (3.70+nmu1ubuntu1) のトリガを処理しています ...
shigeo@shigeo-virtual-machine:~$ 

 

コマンドは問題なく実行された。この先なのか?

 

アイコンはある。

 

起動してみる。エラーになった。

 

裏にこんなのが出ていたのでOS再起動してやってみる。

 

OS再起動後、Unity Hubを起動してみると起動画面は出た。

しかしほどなくまたエラー。

 

再起動してもうまくいかない。起動画面でくるくるである。

 

そこで別手順を探してみた。

kconcon3.hatenablog.com

ダウンロードして実行権限付けて実行である。エラーはこちら。

shigeo@shigeo-virtual-machine:~$ chmod +x UnityHub.AppImage 
shigeo@shigeo-virtual-machine:~$ ./UnityHub.AppImage 
dlopen(): error loading libfuse.so.2

AppImages require FUSE to run. 
You might still be able to extract the contents of this AppImage 
if you run it with the --appimage-extract option. 
See https://github.com/AppImage/AppImageKit/wiki/FUSE 
for more information

--appimage-extract を付けると沢山メッセージが出て抜けてしまう。

shigeo@shigeo-virtual-machine:~$ ./UnityHub.AppImage --appimage-extract
squashfs-root/.DirIcon
squashfs-root/AppRun
squashfs-root/LICENSE.electron.txt
squashfs-root/LICENSES.chromium.html
squashfs-root/chrome_100_percent.pak
squashfs-root/chrome_200_percent.pak
squashfs-root/icudtl.dat
squashfs-root/libEGL.so
squashfs-root/libGLESv2.so
squashfs-root/libffmpeg.so
squashfs-root/license.txt
squashfs-root/locales
(中略)
squashfs-root/usr/share
squashfs-root/usr/share/icons
squashfs-root/usr/share/icons/hicolor
squashfs-root/usr/share/icons/hicolor/2x2
squashfs-root/usr/share/icons/hicolor/2x2/apps
squashfs-root/usr/share/icons/hicolor/2x2/apps/unityhub.png
squashfs-root/usr/share/icons/hicolor/48x48
squashfs-root/usr/share/icons/hicolor/48x48/apps
squashfs-root/usr/share/icons/hicolor/48x48/apps/unityhub.png
squashfs-root/v8_context_snapshot.bin

 

そこでもう一つメッセージが出ているコレに注目してみる。

github.com

実行してみた。

shigeo@shigeo-virtual-machine:~$ sudo add-apt-repository universe
[sudo] shigeo のパスワード: 
コンポーネント 'universe' をすべてのリポジトリに追加しています。
続けるには「Enter」キーを、中止するにはCtrl-cを押してください。
ヒット:1 http://archive.ubuntulinux.jp/ubuntu jammy InRelease                                                     
ヒット:2 http://archive.ubuntulinux.jp/ubuntu-ja-non-free jammy InRelease                                         
ヒット:3 http://nginx.org/packages/ubuntu precise InRelease                                                       
ヒット:4 http://jp.archive.ubuntu.com/ubuntu jammy InRelease                                                      
ヒット:5 http://jp.archive.ubuntu.com/ubuntu jammy-updates InRelease                                              
ヒット:6 http://jp.archive.ubuntu.com/ubuntu jammy-backports InRelease                                            
ヒット:7 http://security.ubuntu.com/ubuntu jammy-security InRelease                                               
ヒット:8 https://brave-browser-apt-release.s3.brave.com stable InRelease                                          
ヒット:9 https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local stable InRelease                          
パッケージリストを読み込んでいます... 完了
W: http://nginx.org/packages/ubuntu/dists/precise/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://hub.unity3d.com/linux/repos/deb/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
shigeo@shigeo-virtual-machine:~$ sudo apt install libfuse2
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています... 完了        
状態情報を読み取っています... 完了        
以下のパッケージが新たにインストールされます:
  libfuse2
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 7 個。
90.3 kB のアーカイブを取得する必要があります。
この操作後に追加で 330 kB のディスク容量が消費されます。
取得:1 http://jp.archive.ubuntu.com/ubuntu jammy/universe amd64 libfuse2 amd64 2.9.9-5ubuntu3 [90.3 kB]
90.3 kB を 0秒 で取得しました (391 kB/s)
以前に未選択のパッケージ libfuse2:amd64 を選択しています。
(データベースを読み込んでいます ... 現在 212090 個のファイルとディレクトリがインストールされています。)
.../libfuse2_2.9.9-5ubuntu3_amd64.deb を展開する準備をしています ...
libfuse2:amd64 (2.9.9-5ubuntu3) を展開しています...
libfuse2:amd64 (2.9.9-5ubuntu3) を設定しています ...
libc-bin (2.35-0ubuntu3.1) のトリガを処理しています ...

 

オプションなしで実行してみると、ダイアログが表示された。[Agree]をクリックする。

 

コケた。

shigeo@shigeo-virtual-machine:~$ ./UnityHub.AppImage 
r: 0
License accepted
Checking for update
Generated new staging user ID: 099afe01-a665-5aae-8fcc-27e741680d18
Update for version 2.4.6 is not available (latest version: 2.4.6, downgrade is disallowed).
Checking for update
Update for version 2.4.6 is not available (latest version: 2.4.6, downgrade is disallowed).
[4274:1022/023006.825260:FATAL:gpu_data_manager_impl_private.cc(892)] The display compositor is frequently crashing. Goodbye.
Trace/breakpoint trap (コアダンプ)

 

色々やってみた。

qiita.com

 

このエラーだけど、

forum.unity.com

Arch Linux でうまく動くよって言われてもな。

 

ということで書いてないことも色々やったけど、うまくいっていないので次はとりあえずUbuntu18.04かmacOSでやってみる。

お時間あったら、他のエントリもクリックして頂ければ幸いです。