rootユーザーのスナップパッケージ警告を無効にするには? [閉鎖]

rootユーザーのスナップパッケージ警告を無効にするには? [閉鎖]

rootユーザーに対して次の警告を無効にしたいと思います。

You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument.

スナップショットを実行するたびに--no-sandboxパラメータを入力する必要はありません。私は彼らにすべてのエイリアスを与えたくありません。私はセキュリティリスクについてよく知っています。個人的な目的のために、仮想マシンでのみこれを行います。設定ファイルを編集したり、このエラーを回避する方法はありますか?

ベストアンサー1

このpython3の解決策を作成しました。

#!/usr/bin/python
import os
import sys


if __name__ == "__main__":
    if len(sys.argv) <= 1:
        print("No snap specified")
        exit(-1)
    else:
        os.system(sys.argv[1] + " --no-sandbox " + ' '.join(sys.argv[2:]))
        exit(0)
                              

パスに追加

例:

コード --user-data-dir ~/.vscode を実行します。

おすすめ記事