0839.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Run Self-Hosted Desktop as a Service with Kasm Workspaces in Docker</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Browser Based,Docker Made Easy,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Kasm,Kasm Workspaces,Desktop As A Service,System Administrator,System Administration,Linux,Docker Made Simple,Docker Host,Docker,Containerization,Container,Stream Docker Containers To Browser,Docker Software As A Service,Software As A Service,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Run Self-Hosted Desktop as a Service with Kasm Workspaces in Docker">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="12/24/2022 07:14:11 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Run Self-Hosted Desktop as a Service with Kasm Workspaces in Docker</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is Kasm Workspaces?</h2>
  26. <blockquote><em>Kasm Workspaces is a docker container streaming platform that enables you to deliver browser-based access to desktops, applications, and web services. Kasm uses a modern DevOps approach for programmatic delivery of services via Containerized Desktop Infrastructure (CDI) technology to create on-demand, disposable, docker containers that are accessible via web browser. -<a href="https://github.com/kasmtech/workspaces-core-images" target="_blank">https://github.com/kasmtech/workspaces-core-images</a></em></blockquote>
  27. <h2>Installing Docker</h2>
  28. <ol>
  29. <li>Log into the Linux based device</li>
  30. <li>Run the following commands in the terminal
  31. <div class="codeBlock"># install prerequisites<br />
  32. sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
  33. # add docker gpg key<br />
  34. curl -fsSL https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release)/gpg | sudo apt-key add -<br />
  35. # add docker software repository<br />
  36. sudo add-apt-repository &quot;deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release) $(lsb_release -cs) stable&quot;<br />
  37. # install docker<br />
  38. sudo apt install docker-ce docker-compose containerd.io -y<br />
  39. # enable and start docker service<br />
  40. sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br />
  41. # add the current user to the docker group<br />
  42. sudo usermod -aG docker $USER<br />
  43. # reauthenticate for the new group membership to take effect<br />
  44. su - $USER</div>
  45. </li>
  46. </ol>
  47. <h2>Deploying Kasm Workspaces [Simple Method]</h2>
  48. <p>This is the recommended installation method, but requires the most disk space. I choose to be more selective about the Kasm images running, so I use the second installation option outlined later on.</p>
  49. <ol>
  50. <li>Continue with the following commands in a terminal window
  51. <div class="codeBlock"># change directory to /tmp<br />
  52. cd /tmp<br />
  53. # download the latest kasm workspaces release<br />
  54. curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.11.0.18142e.tar.gz<br />
  55. # extract the downloaded tar.gz<br />
  56. tar -xf kasm_release*.tar.gz<br />
  57. # execute the installation script<br />
  58. sudo bash kasm_release/install.sh</div>
  59. </li>
  60. <li>Take note of the credentials displayed in the output</li>
  61. <li>Open a web browser and navigate to https://DNSorIP</li>
  62. <li>Log in using username admin@kasm.local and the password found in the installation output</li>
  63. </ol>
  64. <h2>Deploying Kasm Workspaces [Selective Method]</h2>
  65. <p>This method can use far less disk space, but requires more time and setup to add Kasm images manually. I only add the Kasm images I use regularly.</p>
  66. <ol>
  67. <li>Continue with the following commands in a terminal window
  68. <div class="codeBlock"># change directory to /tmp<br />
  69. cd /tmp<br />
  70. # download the latest kasm workspaces release<br />
  71. curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.11.0.18142e.tar.gz<br />
  72. # extract the downloaded tar.gz<br />
  73. tar -xf kasm_release*.tar.gz<br />
  74. # execute the installation script<br />
  75. # installing only the core images<br />
  76. # and setting a custom https port<br />
  77. sudo bash kasm_release/install.sh -I -L 8443</div>
  78. </li>
  79. <li>Take note of the credentials displayed in the output</li>
  80. <li>Open a web browser and navigate to https://DNSorIP:8443</li>
  81. <li>Log in using username admin@kasm.local and the password found in the installation output</li>
  82. </ol>
  83. <h2>Adding Kasm Desktop/Application Images</h2>
  84. <ol>
  85. <li>Navigate to https://hub.docker.com/u/kasmweb to view the available Kasm images</li>
  86. <li>Select Admin at the top of the Kasm web UI</li>
  87. <li>Select Images from the left navigation menu</li>
  88. <li>Click the Add Image button</li>
  89. <li>Complete the Add Image form as follows (Adding Brave Browser in this example)
  90. <p>Docker Image: kasmweb/brave:1.11.0-rolling<br />
  91. Description: Brave Browser<br />
  92. Friendly Name: Brave Browser<br />
  93. Thumbnail URL: https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Brave_lion_icon.svg/654px-Brave_lion_icon.svg.png<br />
  94. Cores: 1<br />
  95. Memory (MB): 1024<br />
  96. GPU Count: 0<br />
  97. Docker Registry: hub.docker.com<br />
  98. Persistent Profile Path: /home/{username}/brave</p>
  99. </li>
  100. <li>Scroll to the bottom of the form and click the Submit button</li>
  101. <li>Click Workspaces at the top of the Kasm web UI</li>
  102. <li>Click the new image &gt; Click Launch Session</li>
  103. </ol>
  104. <p>Documentation: <a href="https://kasmweb.com/docs/latest/index.html" target="_blank">https://kasmweb.com/docs/latest/index.html</a></p>
  105. <p>Source: <a href="https://kasmweb.com/docs/latest/install/single_server_install.html" target="_blank">https://kasmweb.com/docs/latest/install/single_server_install.html</a></p> </div>
  106. </div>
  107. </body>
  108. </html>