diff --git a/README.md b/README.md index ba873a9..e96949a 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,77 @@ ModelSim Version 16 GUI Running under docker container ## Steps for Linux: -First you need to exec the `xauth list` on your host terminal. The aprox result will be: +First you need to exec the `xauth list` on your host terminal. The aprox result +will be:
+`/unix: MIT-MAGIC-COOKIE-1 `
+Then exec `echo $DISPLAY`. The result will be **:1** or **:0**
+Run the container with the following command:
+`sudo docker run -i -t --name modelsim --net=host -e DISPLAY -v /tmp/.X11-unix goldensniper/modelsim-docker bash` -`/unix: MIT-MAGIC-COOKIE-1 ` - -Then exec `echo $DISPLAY`. The result will be **:1** or **:0** +Now inside the container exec the following command:
+`xauth add /unix: MIT-MAGIC-COOKIE-1 ` -Run the container with the following command: +Where the third arg is the result of `xauth list` command on your host and +`` is the **$DISPLAY** host machine value.
-`sudo docker run -i -t --name modelsim --net=host -e DISPLAY -v /tmp/.X11-unix goldensniper/modelsim-docker bash` +Finally exec `vsim` and enjoy. :) -Now inside the container exec the following command: +Example:
+1. `xauth list`
+![sc](https://user-images.githubusercontent.com/43972902/129357595-3713e40a-62b0-493e-95b4-bf8a2b05dc44.png) -`xauth add /unix: MIT-MAGIC-COOKIE-1 ` +2. `echo $DISPLAY`
+![2](https://user-images.githubusercontent.com/43972902/129357943-7abbab00-86a7-43b9-82b1-e22972e0e206.png) -Where the third arg is the result of `xauth list` command on your host and `` is the **$DISPLAY** host machine value. +3. First usage modelsim docker command:
+`docker run -i -t --name modelsim --net=host -e DISPLAY -v /tmp/.X11-unix goldensniper/modelsim-docker bash`
+![3](https://user-images.githubusercontent.com/43972902/129358020-fb3d7812-ad52-4906-8705-07394ba3cb72.png) -Finally exec `vsim` and enjoy. :) +4. After running container set XServer:
+`xauth add mozerpol-pc/unix:0 MIT-MAGIC-COOKIE-1 fbcd4b1744cd112081823023de2e57ec`
+![3](https://user-images.githubusercontent.com/43972902/129358286-5d025787-94a4-4aff-bf79-9004408463c7.png) + +5. After this you should can run *vsim*:
+![4](https://user-images.githubusercontent.com/43972902/129358116-fc510cc4-7236-432f-9a15-cfb26f4ae898.png) + +## How to use modelsim with docker +**How to run modelsim after installation:**
+1. List all containers and note ID: `docker ps -a`
+![1](https://user-images.githubusercontent.com/43972902/129359170-fcad70ab-2e8b-4eb3-aaa7-e4a6fdbbef3c.png) + +2. Run docker: `docker start 563bcbca514b`
+![2](https://user-images.githubusercontent.com/43972902/129359497-a6c24684-0e09-41ac-85fa-c9e4d05135f2.png) + +3. Run modelsim: `docker exec -it 563bcbca514b vsim`
+![q](https://user-images.githubusercontent.com/43972902/129359952-b831ac92-6590-4331-9cce-aad4bfcd3391.png)
+Now you can notice that container change their ID:
+![x](https://user-images.githubusercontent.com/43972902/129360141-bee778d0-35f5-4101-8903-770921d3fec4.png) + +4. If you want stop docker just: `docker stop 563bcbca514b` + +## How to pass files between host and docker +**One file:** *docker cp file_name containerID:destination*:
+`docker cp design.v 563bcbca514b:/design.v`
+After this file *design.v* will appear in */* directory.
+**Folder:** *docker cp what containerId:destination*:
+`docker cp ./ 563bcbca514b:/target`
+After this I'll create a new folder *target* inside */* directory with files from +host under *./* directory. + +More info +[here](https://stackoverflow.com/questions/22907231/how-to-copy-files-from-host-to-docker-container). + +After all it looks like this (just as a normal modelsim ;D) :
+![s](https://user-images.githubusercontent.com/43972902/129363715-73a3a95d-299c-43e4-937a-181d300f5c9e.png) + +## Possible errors +If you have error like this: +```shell +root@mozerpol-pc:/home/mozerpol# docker exec -it 563bcbca514b vsim +** Warning: setting ADDR_NO_RANDOMIZE failed - Operation not permitted. +Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyTk initialization failed: couldn't connect to display ":0". +``` + +To get rid this just run `xhost +local:`.
+Solution found +[here](https://unix.stackexchange.com/questions/199891/invalid-mit-magic-cookie-1-key-when-trying-to-run-program-remotely).