![rootユーザーのスナップパッケージ警告を無効にするには? [閉鎖]](https://linux33.com/image/213018/root%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%AE%E3%82%B9%E3%83%8A%E3%83%83%E3%83%97%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E8%AD%A6%E5%91%8A%E3%82%92%E7%84%A1%E5%8A%B9%E3%81%AB%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%EF%BC%9F%20%5B%E9%96%89%E9%8E%96%5D.png)
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 を実行します。