From eb7d0c02ff5ac7affb153b13259644222f7cfe1a Mon Sep 17 00:00:00 2001 From: mozerpol Date: Fri, 13 Aug 2021 14:42:22 +0200 Subject: [PATCH 1/6] Desc example of running modelsim container --- README.md | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ba873a9..db12afc 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,39 @@ 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:
+`xauth list`
+![sc](https://user-images.githubusercontent.com/43972902/129357595-3713e40a-62b0-493e-95b4-bf8a2b05dc44.png) -`xauth add /unix: MIT-MAGIC-COOKIE-1 ` +`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. +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. :) +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) + +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 ** From 30f12bc445a3405499d546ed068b86f06549d3c1 Mon Sep 17 00:00:00 2001 From: mozerpol Date: Fri, 13 Aug 2021 15:04:14 +0200 Subject: [PATCH 2/6] Desc second usage modelsim --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index db12afc..c9cd166 100644 --- a/README.md +++ b/README.md @@ -37,4 +37,16 @@ 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 ** +**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` From 6620446b4262222cc8fffdffed83042f581054ea Mon Sep 17 00:00:00 2001 From: mozerpol Date: Fri, 13 Aug 2021 15:18:01 +0200 Subject: [PATCH 3/6] Add desc how to copy files to docker --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index c9cd166..58dd761 100644 --- a/README.md +++ b/README.md @@ -50,3 +50,17 @@ 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 From 1be6eba2f2da7d300fb6f1af88c1ca33d3070cfc Mon Sep 17 00:00:00 2001 From: mozerpol Date: Fri, 13 Aug 2021 15:27:14 +0200 Subject: [PATCH 4/6] Add screen from modelsim --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 58dd761..a44c488 100644 --- a/README.md +++ b/README.md @@ -18,22 +18,21 @@ Where the third arg is the result of `xauth list` command on your host and Finally exec `vsim` and enjoy. :) Example:
-`xauth list`
+1. `xauth list`
![sc](https://user-images.githubusercontent.com/43972902/129357595-3713e40a-62b0-493e-95b4-bf8a2b05dc44.png) -`echo $DISPLAY`
+2. `echo $DISPLAY`
![2](https://user-images.githubusercontent.com/43972902/129357943-7abbab00-86a7-43b9-82b1-e22972e0e206.png) -First usage modelsim docker command:
+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) -After running container set XServer:
-`xauth add mozerpol-pc/unix:0 MIT-MAGIC-COOKIE-1 fbcd4b1744cd112081823023de2e57ec` -
+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) -After this you should can run *vsim*:
+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 @@ -63,4 +62,5 @@ 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 +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) From 0df49aa4d775f7cbee8f3e6efd75411c4793b818 Mon Sep 17 00:00:00 2001 From: Mozerpol <43972902+mozerpol@users.noreply.github.com> Date: Mon, 16 Aug 2021 11:20:33 +0200 Subject: [PATCH 5/6] Add possible errors --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index a44c488..6825056 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,15 @@ More info 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]. From 193122012732e13b83ffd7c3b927c878352fb675 Mon Sep 17 00:00:00 2001 From: Mozerpol <43972902+mozerpol@users.noreply.github.com> Date: Mon, 16 Aug 2021 11:26:30 +0200 Subject: [PATCH 6/6] Fix hyperlink --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6825056..e96949a 100644 --- a/README.md +++ b/README.md @@ -75,4 +75,4 @@ Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyTk initialization fa 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]. +[here](https://unix.stackexchange.com/questions/199891/invalid-mit-magic-cookie-1-key-when-trying-to-run-program-remotely).