準備した「ghcr.io/epicgames/unreal-engine:dev-slim-5.4.4」を使ってTESTProjectをビルドしてみる。
まず、Windows11のUE5.4.4でエディタを起動しファーストパーソンを作成する
D:\ContainerTESTというフォルダを作ってこの中にTESTProjectという名前で作成する
作成したらお終いでUEエディタを終了する。
でWSLのUbuntu22.04でマウント状態を確認する
root@:~# df Filesystem 1K-blocks Used Available Use% Mounted on none 4055048 0 4055048 0% /usr/lib/modules/5.15.167.4-microsoft-standard-WSL2 none 4055048 4 4055044 1% /mnt/wsl drivers 499117052 300503700 198613352 61% /usr/lib/wsl/drivers /dev/sdc 1055762868 42687872 959371524 5% / none 4055048 84 4054964 1% /mnt/wslg none 4055048 0 4055048 0% /usr/lib/wsl/lib rootfs 4051640 2208 4049432 1% /init none 4055048 784 4054264 1% /run none 4055048 0 4055048 0% /run/lock none 4055048 0 4055048 0% /run/shm tmpfs 4096 0 4096 0% /sys/fs/cgroup none 4055048 64 4054984 1% /mnt/wslg/versions.txt none 4055048 64 4054984 1% /mnt/wslg/doc C:\ 499117052 300503700 198613352 61% /mnt/c D:\ 1953513468 50883368 1902630100 3% /mnt/d J:\ 976762524 430057796 546704728 45% /mnt/j snapfuse 93952 93952 0 100% /snap/gtk-common-themes/1535 snapfuse 128 128 0 100% /snap/bare/5 snapfuse 75776 75776 0 100% /snap/core22/864 snapfuse 41856 41856 0 100% /snap/snapd/20290 snapfuse 75648 75648 0 100% /snap/core22/1722 snapfuse 45440 45440 0 100% /snap/snapd/23258 snapfuse 134272 134272 0 100% /snap/ubuntu-desktop-installer/1276 snapfuse 134912 134912 0 100% /snap/ubuntu-desktop-installer/1286
D:\は/mnt/dでマウントされているのが確認できる
/mnt/dの中を確認するとContainerTESTがあるのが確認できる
root@:# ls -l /mnt/d ls: 'System Volume Information': Permission denied total 40254716 drwxrwxrwx 1 root root 4096 Dec 12 2023 '$RECYCLE.BIN' drwxrwxrwx 1 root root 4096 Nov 25 14:34 BlueprintScreenshotTool_5.4 drwxrwxrwx 1 root root 4096 Dec 24 14:01 ContainerTEST drwxrwxrwx 1 root root 4096 Mar 29 2024 SD16GB d--x--x--x 1 root root 4096 Nov 25 13:22 'System Volume Information' drwxrwxrwx 1 root root 4096 Jan 11 2024 msdownld.tmp -rwxrwxrwx 1 root root 41041142784 Dec 24 10:38 ue544.tar
確認できたので公式手順で動かしてみる
まず、コンテナを起動する
docker run --rm -ti -v "/mnt/d/ContainerTEST/TESTProject:/project" ghcr.io/epicgames/unreal-engine:dev-slim-5.4.4
/mnt/d/ContainerTEST/TESTProjectは以下のような構成になっているのでTESTProject.uprojectまでのパスを指定する
起動したら次のコマンドを実行する
ue4@7652a7aa609a:~/UnrealEngine$ /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh \ BuildCookRun \ -utf8output \ -platform=Linux \ -clientconfig=Shipping \ -serverconfig=Shipping \ -project=/project/TESTProject.uproject \ -noP4 -nodebuginfo -allmaps \ -cook -build -stage -prereqs -pak -archive \ -archivedirectory=/project/Packaged Running AutomationTool... Setting up bundled DotNet SDK Start UAT Interactively: dotnet AutomationTool.dll BuildCookRun -utf8output -platform=Linux -clientconfig=Shipping -serverconfig=Shipping -project=/project/TESTProject.uproject -noP4 -nodebuginfo -allmaps -cook -build -stage -prereqs -pak -archive -archivedirectory=/project/Packaged /home/ue4/UnrealEngine/Engine/Build/BatchFiles/Linux/../../../Binaries/ThirdParty/DotNet/6.0.302/linux/dotnet Starting AutomationTool... . . . Running: /usr/bin/env -- "chmod" "+x" "/project/Intermediate/Staging/TESTProject.sh" chmod: changing permissions of '/project/Intermediate/Staging/TESTProject.sh': Operation not permitted Took 0.01s to run env, ExitCode=1 Failed to chmod "/project/Intermediate/Staging/TESTProject.sh" (see /home/ue4/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace) AutomationTool executed for 0h 7m 55s AutomationTool exiting with ExitCode=1 (Error_Unknown) RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 1
ビルド途中でFailed to chmod “/project/Intermediate/Staging/TESTProject.sh”と怒られた!
/usr/bin/env -- "chmod" "+x" "/project/Intermediate/Staging/TESTProject.sh" chmod: changing permissions of '/project/Intermediate/Staging/TESTProject.sh': Operation not permitted
パーミッションの変更に失敗するとのこと。
試しにこれを単体で実行してみると
# エラーになる ue4@7652a7aa609a:~/UnrealEngine$ /usr/bin/env -- "chmod" "+x" "/project/Intermediate/Staging/TESTProject.sh" chmod: changing permissions of '/project/Intermediate/Staging/TESTProject.sh': Operation not permitted # エラーにならない ue4@7652a7aa609a:~/UnrealEngine$ sudo /usr/bin/env -- "chmod" "+x" "/project/Intermediate/Staging/TESTProject.sh"
sudoで実行すればエラーにならないみたい。どうすりゃいい?ue4をsudoにしちゃえばOK?
ue4@08c4655e3ab8:~/UnrealEngine$ sudo gpasswd -a ue4 sudo Adding user ue4 to group sudo
だめだった(-_-;)
# all users cat /etc/passwd | cut -d : -f 1 # all groups cat /etc/group | cut -d : -f 1 # WSL sudo umount /mnt/d sudo mount -t drvfs D:\ /mnt/d -o metadata
こちらに記載があった