<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Joe Horsnell on Medium]]></title>
        <description><![CDATA[Stories by Joe Horsnell on Medium]]></description>
        <link>https://medium.com/@bitsojoe?source=rss-65cf4e617bc6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OqFsUDhauWYwLlrID_Xvmg.png</url>
            <title>Stories by Joe Horsnell on Medium</title>
            <link>https://medium.com/@bitsojoe?source=rss-65cf4e617bc6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 21:41:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bitsojoe/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Up and running with Rancher Desktop and Testcontainers on Apple M3]]></title>
            <link>https://medium.com/bitso-engineering/up-and-running-with-rancher-desktop-and-testcontainers-on-apple-m3-b57c4d9a8c99?source=rss-65cf4e617bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b57c4d9a8c99</guid>
            <dc:creator><![CDATA[Joe Horsnell]]></dc:creator>
            <pubDate>Tue, 13 Feb 2024 15:43:59 GMT</pubDate>
            <atom:updated>2024-02-13T15:43:59.827Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NywcsKXlVU17b_PAmXMs8g.png" /></figure><p>At Bitso, we are passionate about great open-source software, such as <a href="https://rancherdesktop.io/">Rancher Desktop</a> and <a href="https://testcontainers.com/">Testcontainers</a>.</p><p>We are also committed to giving our engineers the best tools possible, so we are currently rolling out new high-spec M3 laptops across the engineering organisation.</p><p>This post covers some interesting issues we encountered testing Bitso’s primary development stack with Rancher Desktop on Apple M3 Silicon.</p><h3>Summary</h3><ul><li>The current Rancher Desktop version (<a href="https://github.com/rancher-sandbox/rancher-desktop/releases/tag/v1.12.3">1.12.3</a>) does <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/5943">not work</a> out of the box on Apple M3 due to a bug in QEMU, so you must use VZ emulation</li><li>Using VZ emulation causes a <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/2854">conflict</a> with Cloudflare WARP and other DNS-related tools that expect to bind mDNSResponder on port 53, so needs a workaround</li><li><a href="https://testcontainers.com/">Testcontainers</a> does <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/2609">not currently work</a> out of the box with Rancher Desktop on any Apple Silicon variants (eg M1, M2, etc.) and requires specific environment variables to be set</li></ul><h3>Rancher Desktop on M3</h3><p>Rancher Desktop is an open-source container management application for macOS, Linux, and Windows. It provides a Docker-compatible interface, including support for Docker Compose, so is a viable, free alternative to Docker Desktop for commercial use.</p><p>Rancher Desktop is<a href="https://docs.rancherdesktop.io/getting-started/installation/#macos"> supported</a> on macOS running on either Intel chips with<a href="https://en.wikipedia.org/wiki/X86_virtualization#Intel_virtualization_(VT-x)"> VT-x</a> instructions or Apple Silicon (M1) and has dedicated x64 and ARM64<a href="https://github.com/rancher-sandbox/rancher-desktop/releases"> builds</a>.</p><h4>Installation and overview</h4><p>See <a href="https://docs.rancherdesktop.io/getting-started/installation/#macos">here</a> for a quick overview of installation, or if you have Homebrew installed, you can just use the <a href="https://formulae.brew.sh/cask/rancher">rancher cask</a>:</p><pre>❯ brew install --cask rancher</pre><p><strong>Note</strong>: you will need to uninstall Docker Desktop if you installed it using Homebrew as the casks conflict. Currently Rancher Desktop <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/1081">does not detect</a> other container management applications running.</p><p>Rancher Desktop’s basic <a href="https://docs.rancherdesktop.io/references/architecture/">architecture</a> is an Electron GUI wrapped around several other tools to provide a simplified user experience for container management.</p><p>Under the hood, Rancher Desktop uses <a href="https://lima-vm.io/">Lima</a> (LInux MAchines) to provide a Linux virtual machine to run the required software, such as the container daemon (<a href="https://earthly.dev/blog/containerd-vs-docker/">containerd or dockerd</a>) and Kubernetes, if enabled.</p><p>Lima, in turn, depends on emulation software to provide the actual hardware virtualisation and offers different <a href="https://lima-vm.io/docs/config/vmtype/">VM types</a> depending on the host OS. On macOS, those options are either <a href="https://www.qemu.org/">QEMU</a> or experimental support for <a href="https://developer.apple.com/documentation/virtualization">VZ</a>, Apple’s native macOS Virtualisation Framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*HawA0sQ_zpTww-jQmtYqmA.png" /></figure><h4>Now to the issue…</h4><p>If you install Rancher Desktop on M3 with the default settings, it will just appear to hang saying “Starting virtual machine”, without the Docker daemon starting:</p><pre>❯ docker ps<br>Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?</pre><p>The <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/5943">issue</a> with running Rancher Desktop on M3 is caused by an <a href="https://github.com/lima-vm/lima/issues/1996">issue</a> in Lima, which in turn is caused by a <a href="https://gitlab.com/qemu-project/qemu/-/issues/1990">problem</a> in the bottom layer of these dependencies, QEMU, on M3.</p><p>You can see the exception in the logs:</p><pre>❯ head -5 ~/Library/Logs/rancher-desktop/lima.serial.log<br><br>UEFI firmware (version edk2-stable202302-for-qemu built at 17:14:55 on Mar 15 2023)<br>Error: Image at 0043FD41000 start failed: Not Found<br><br><br>Synchronous Exception at 0x000000043FD37E08</pre><p>If you’re interested in more detail, the issue threads have a lot more information. Still, until the underlying fix to QEMU makes its way up the chain of dependencies, the workaround for now is not to use QEMU and use the (experimental) VZ emulation instead.</p><p>Open the Rancher Desktop Preferences dialog, click <strong>Virtual Machine</strong>, then <strong>Emulation</strong>, and click <strong>VZ</strong> under <strong>Virtual Machine Type</strong>. You can also select <strong>Enable Rosetta support</strong> if you want to be able to run Intel images in Rancher Desktop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DIU6hNuh2HrXvY0u" /></figure><p>Click <strong>Apply</strong>, which should restart Rancher Desktop with the new settings.</p><p><strong>Note</strong>: We found that this restart process can be <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/5943#issuecomment-1898155563">unreliable</a>, and rogue Rancher Desktop processes can be left running, so if things appear to be still not working, quit out of Rancher Desktop completely, then in your terminal, make sure there are no Rancher Desktop processes still running:</p><pre>❯ ps auxww | grep -i rancher<br><br># kill -9 any rogue Rancher Desktop process IDs</pre><p>Simply <em>kill — 9</em> any Rancher Desktop processes still running, then restart Racher Desktop.</p><h4>Further gotcha with Cloudflare WARP</h4><p>If you use <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/">Cloudflare WARP</a> or any other DNS-related tools that expect to be able to run <a href="https://developer.apple.com/library/archive/documentation/Networking/Conceptual/dns_discovery_api/Introduction.html">mDNSResponder</a> on port 53, you may also encounter <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/2854">this</a> issue, where Rancher Desktop causes a conflict by taking over port 53.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/0*Bcm_oc6Iorg15jqY" /></figure><p>The <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/2854#issuecomment-1917593505">workaround</a> suggested in the issue thread only works when using QEMU emulation, so for M3, where you must use VZ for now, the workaround <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/2854#issuecomment-1916635386">does not work</a>.</p><p>There is no official workaround for this issue currently. Still, <strong>you can manually get things working</strong> by ensuring that Cloudflare WARP is running and connected first before running Rancher Desktop, which will then pick another port.</p><h3>Test containers on Apple Silicon</h3><p>Testcontainers is a powerful open source framework for bootstrapping infrastructure dependencies, such as Postgres databases and Redis caches, for integration tests using containers.</p><p>If you try and use Rancher Desktop as a drop-in replacement for Docker Desktop with Testcontainers on Apple Silicon, you may run into <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/2609">this</a> issue and find that Testcontainers can’t connect, giving an error like the Java example below:</p><pre>Can not connect to Ryuk at localhost:32768<br>java.net.ConnectException: Connection refused</pre><p>There is currently no fix for this issue; the exact cause is unknown. However, you can work around it by setting some environment variables <a href="https://github.com/rancher-sandbox/rancher-desktop/issues/2609#issuecomment-1718556068">mentioned</a> in the issue thread by <a href="https://github.com/jandubois">@jandubois</a> of the Rancher team and <a href="https://docs.rancherdesktop.io/how-to-guides/using-testcontainers">documented</a> in the Rancher guides.</p><p>The environment variables you must export in your shell vary depending on whether you are running Rancher Desktop with administrative access or not:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b-xIseNzo84T-5n2" /></figure><h4>With Administrative Access</h4><pre>export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show vznat | awk &#39;/inet / {sub(&quot;/.*&quot;,&quot;&quot;); print $2}&#39;)</pre><h4>Without Administrative Access</h4><pre>export DOCKER_HOST=unix://$HOME/.rd/docker.sock<br>export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock<br>export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show vznat | awk &#39;/inet / {sub(&quot;/.*&quot;,&quot;&quot;); print $2}&#39;)</pre><p>These environment variables must be exported in your shell before running any builds that use Testcontainers.</p><p>That’s it — we hope you found this post useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b57c4d9a8c99" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bitso-engineering/up-and-running-with-rancher-desktop-and-testcontainers-on-apple-m3-b57c4d9a8c99">Up and running with Rancher Desktop and Testcontainers on Apple M3</a> was originally published in <a href="https://medium.com/bitso-engineering">bitso.engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>