This Docker image provides an environment for running LTspice, a popular electronic circuit simulation software, using Wine on a Linux image. It is based on the scottyhardy/docker-wine project and includes additional configurations specific to running LTspice.
aanas0sayed/docker-ltspice
is aimed for running LTspice for bulk simulations as part of pipelines. Headless operations will require Xvfb to be set up correctly. This is currently in the pipeline.
Images are available on DockerHub.
docker pull aanas0sayed/docker-ltspice
Important
The base image is linux/amd64
and will not work on a machine running with a arm64
architecture unless --platform linux/amd64
is added to the docker run
command.
docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix aanas0sayed/docker-ltspice
-
Install XQuartz:
brew install --cask xquartz
-
Logout and login of your Mac to activate XQuartz as the default X11 server.
-
Start XQuartz:
open -a XQuartz
-
Enable "Allow connections from network clients" in Security Settings.
-
Restart your Mac and start XQuartz again:
open -a XQuartz
Note
If connecting to a remote server, the access control will need to be modified. Running xhost +
allows any client to connect (not recommended). If you have security concerns you can append an IP address for a whitelist mechanism. Alternatively, if you want to limit X11 forwarding to local containers, you can limit clients to localhost only via xhost +localhost
This is not a persistent setting.
-
Run the container:
docker run -it --rm -e DISPLAY=docker.for.mac.host.internal:0 -v /tmp/.X11-unix:/tmp/.X11-unix aanas0sayed/docker-ltspice
For MacBook M series (ARM chip), add --platform linux/amd64
to the command.
For support on this topic, please check the guide on X11 forwarding on macOS and docker
docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --user=$(id -u):$(id -g) aanas0sayed/docker-ltspice
This command runs the container with the same username, UID, GID, and home path as your current user, allowing you to interact with files on the local file system without permissions issues.
-
Run with RDP server enabled (as root):
docker run -it --rm -e RDP_SERVER=yes -p 3389:3389 aanas0sayed/docker-ltspice
-
Run with RDP server enabled (as current user):
docker run -it --rm -e RDP_SERVER=yes -p 3389:3389 -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) aanas0sayed/docker-ltspice
For more options and detailed usage instructions on the base image, refer to the scottyhardy/docker-wine.
-
Test the display:
ltspice wine notepad
-
Test the sound:
ltspice pacat -vv /dev/urandom
If you find any issues or have suggestions for improvements, please contribute by creating a GitHub issue or submitting a pull request.
This project is licensed under the MIT License. For more details, please refer to the LICENSE file.