Install MacOS VM in UTM for Codex sandboxing

I am trying out a MacOS VM on MacOS host to run Codex with "Full Access" permissions. Here is how I set it up after some trial and error. 

Table of Contents


Choose MacOS version for guest VM

  • Tahoe is latest OS (as of May 2026), but it's very slow when VM is allocated. For other MacOS versions as guest, following restrictions apply:
  • Guest OS VersionAvailableNot Available
    MacOS 12 Monterey-

    Shared folders

    Clipboard

    Guest tools

    MacOS 13 Ventura

    Shared folders 

    (Source)

    Clipboard

    Guest tools

    MacOS 14 SonomaShared folders

    Clipboard

    Guest tools

    MacOS 15 Sequoia

    Shared folders

    Clipboard

    Guest tools

    (Source)

    --
    MacOS 26 Tahoe

    --

    --
     
  • I'm currently using Ventura hoping that I can live without shared clipboard (between host and guest) Sequoia. I downloaded Ventura's Sequoia IPSW from macOS Ventura Final IPSW Firmware files section of mrmacintosh.com. This is safer option compared to other sites, as mrmacintosh links to apple servers for all .IPSW download links.

Setup VM on UTM

Any VM is a battery hog. I recommend keeping the Mac plugged in while the VM is running. Also for long running tasks, I recommend to set: UTM > Settings > Application > Select "Prevent system from sleeping when any VM is running"

  • Install UTM on mac.
  • Add new VM using "Virtualization"
  • During installation, assign 8GB RAM for faster installation (after successful installation, try to reduce it to 6GB and if it works for your usecase without lag). Choose default settings for other.

Setup Guest OS inside VM 

  • Once VM is installed, MacOS will boot first time. Don't login to Apple account if this VM is for sandboxing Codex (or Claude code or any other LLM models). I recommend running it without an apple account, and if needed you can create a new apple account for this VM later.
  • Install guest tools: Menu bar > virtual machine > Drives > Install Guest Tools
    • This will mount a disk inside virtual machine (similar to a usb drive). Use finder to open it and install guest tools. I'm not sure if reboot is needed, but reboot just in case.
    • If you are on Sequoia or later, clipboard sharing (between host and guest) should be working now.
  • Shutdown the VM. 
    • Save it's password in VM notes (in case you have a tendency to forget passwords). I know it's not safe, but this is what I prefer.
    • Reduce RAM to 6GB.
    • Change resolution to Display > 2560 × 1664 — MacBook Air (13-inch, 2022) and select HiDPI (Retina). This worked really well on my Macbook Air M5, but you might have to play around with different resolutions until you find an optimal one for your setup.
    • Add shared folders. Any shared folder is automatically mounted on guests running MacOS 13 Ventura or above. If you can't find it, goto Finder > Go > Computer > My Shared Files. I recommend to share the following folders from host to guest:
      • your projects folder
      • your ~/.codex/ to share auth.json as well as any skills, agents, prompts etc. that you are using on host.
      • If you are using codex-account-switcher, then the folder which contains multiple auth.jsons for codex. 
      •  

 Install and setup dependencies

  • brew.sh
  • Using brew:
    • brew install codex-app macdown-3000 stats google-chrome ripgrep tmux wget jq imageoptim imageoptim-cli ffmpeg codex moom
  • Install nvm to install node / npm (npm is needed for codex cli):
    • Install nvm (Source): curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
      • Create ~/.zshrc using output printed from nvm installation command (to add nvm to PATH).
    • Install nodejs v24: nvm install 24
    • Check if node / npm is installed using node -v ; npm -v
  • Setup Codex app
    • Select "Full access" in chatbox
    • Enable Remotion plugin
    • Enable chrome plugin (and install accompanying Chrome Extension)
    • Allow notifications (Send a "Hi" to new chat, then codex will ask for notification permissions).
    • Login to Chatgpt mobile
  • Install codex-account-switcher
    • Select folder containing multiple auth.jsons 
    • Choose "Start on login"
  • Setup Chrome
    • Settings > On Startup: Continue where you left off
  • Moom 
    • Setup 3x2 grid in Moom:
      • Finder+Terminal
      • Chrome+Macdown
      • Codex App

Enable Automatic login

  • Apple menu  > System Settings.
  • Click Users & Groups in the left sidebar.
  • Look for Automatically log in as on the right side and select your user account.
  • Enter your current user password to verify. [1]

Disable sleep/screensaver

  • Settings > Lock Screen > Choose "Never" across all relevant options.

Always use tabs for multiple windows

System Settings > Desktop and Dock > Windows > Prefer Tabs when opening documents > Always.

To be done:

  • Trying: "Default" cores and 6gb ram
  • How to move .codex shared to home
  • how to access projects in codex
  • how to access chatgpt multiple logins in codex-account-switcher
  • new agents location used by all clients
  • Install?
    •  
  • git login
  • zshrc kept in dropbox

 

Maybe not

  • brew install git - as mac already has git

Related post