0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VirtualBox の共有フォルダで発生した Python の os.mkfifo エラー「PermissionError: [Errno 1] Operation not permitted」の解決

Last updated at Posted at 2025-01-22

発生状況

VirtualBox 上で Python を使ってパイプ通信を試みた際、エラーが発生しました。

解決方法

あまりにも単純なことだったため、結論を先に書きます。
os.mkfifo() に渡す第一引数 をホスト環境の Vagrantfile に設定していた ゲスト環境との共有フォルダ以外の場所 に変更することでエラーが解決しました。

以下は、補足情報になります。

実行環境

  • ホスト環境

    • Let's note CF-SZ6
    • OS: Windows 11 Pro 22H2
    • CPU: Core i5-7300U
    • GPU: Intel HD Graphics 620
    • RAM: 8GB
  • ゲスト環境

    • VirtualBox 6.1
    • Ubuntu 20.04.6 LTS
    • Python 3.8.10

発生したエラー

fifotest.py

import os
os.mkfifo("pipe", 0o600)

ターミナル

vagrant@ubuntu-focal:~/workspace/$ python3 fifotest.py
Traceback (most recent call last):
  File "fifotest.py", line 2, in <module>
    os.mkfifo("pipe", 0o600)
PermissionError: [Errno 1] Operation not permitted

試したこと

ファイルやディレクトリの権限を確認しましたが、特に問題は見つかりませんでした。エラーの原因として気になったのは、コードを実行していたディレクトリが Windows との共有フォルダ (~/workspace/) であったことです。

参考にした情報

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?