TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Developing inside a virtual machine

190 点作者 disintegrator5 个月前

34 条评论

cranium4 个月前
(Tangentially related) I had to run the desktop version of Excel to develop a quick VBA macro for a client. Problem: I&#x27;ve been developing on a Linux box for years and the idea of leaving my cozy dev environment for a plain Windows install gave me chills.<p>After failing to install Windows in a VM (thanks TPM), I found a way to run Windows apps nearly natively (<a href="https:&#x2F;&#x2F;github.com&#x2F;winapps-org&#x2F;winapps">https:&#x2F;&#x2F;github.com&#x2F;winapps-org&#x2F;winapps</a>). It works by starting a Windows docker image and streaming the application frame with RDP. As the RDP client handles the copy&#x2F;paste and other niceties such as shared directories, it&#x27;s way easier to integrate in my env than the other options.
评论 #42581324 未加载
nneonneo4 个月前
You can use pbcopy&#x2F;pbpaste in a Linux VM on Mac by making a shell script wrapper in the VM that calls “ssh mac-host pb{copy|paste}” - that is, basically ssh back from the guest to the host to use its clipboard. It’s seamless and fast since it’s basically a local network connection.<p>My specific setup is that I use an authorized_keys entry on the host that restricts the guest to running a specific command, which limits what a compromised guest can do to the host. The command is set to a script that has a list of specific permitted actions. This is a good option if you’re looking for a bit of additional isolation between host and guest.
评论 #42577371 未加载
评论 #42571303 未加载
评论 #42572199 未加载
评论 #42570636 未加载
评论 #42585313 未加载
评论 #42576827 未加载
apt-apt-apt-apt4 个月前
I accidentally typed &#x27;npm install axioss&#x27; (extra s typo) this morning.<p>When it successfully installed, it was terrifying to think that all source code, private files were instantly shared with malicious actors. Not only that, there was the prospect of having to somehow wipe and ensure all files were clean, reinstall the OS, and the possibility of some bootloader remnant still lurking.<p>In this case, it seems that a security package had replaced a previous malicious package, making this instance benign. But it feels like I am only one typo away from an absolute catastrophe every time I install a package.<p>VM seems like a good way to add some protection.
评论 #42575667 未加载
评论 #42574855 未加载
评论 #42571229 未加载
Abishek_Muthian4 个月前
I do a switcharoo, I develop for iOS inside a macOS VM with Linux host.<p>After a 5 years hiatus I started developing mobile apps again and I was frustrated to learn that Apple doesn&#x27;t allow renewing the developer license on web anymore, I don&#x27;t own a Mac and even Apple developer app on iPhone didn&#x27;t allow me to renew my license.<p>After I signed into a macOS VM, I was able to renew my license through Apple Developer App on iPhone as macOS version of the app requires T2 chip.<p>Now I have PTSD flashbacks of why I left mobile development in first place.
评论 #42573041 未加载
TowerTall4 个月前
I run my entire work computer inside of a VM. I work from home and have a powerfull desktop i use for my private stuff hooked up to my 3 monitors. My work pc is a vmware vm running inside of vmware pro. I can minimize the work vm and work it out my sight or I can selective choose that the vm should use 1, 2 or 3 monitors and it is easy to switch back and forth between work and private without have any work related data on my private desktop. The work vm is domain joined, o365 enterprise joined and loocked down in ridicilous ways by cooperate IT but now i can run that from my private powerfull PC without worring that corp IT messes up my private computer.
评论 #42573181 未加载
moritonal4 个月前
Thr Dev Container ecosystem for VsCode really is quite impressive at the moment. All your dev dependencies, wrapped up in a docker image per repo.
评论 #42572452 未加载
评论 #42571364 未加载
mongol4 个月前
I do something similar but using WSL on Windows. But something I really, really hate is dealing with special certificate handling required to pass the corporate Zscaler proxy. I think it works somewhat transparent on the Windows host, but repeating the setup in every VM is such a pain.
评论 #42571118 未加载
评论 #42570143 未加载
评论 #42569992 未加载
disintegrator4 个月前
Author here. Thank you for all the tips. I especially like the idea of using ssh from guest to host to enable pbcopy&#x2F;pbpaste and open.<p>Now I know what all the WSL users experience seamlessly with their setups. Glad I have something that comes close.
评论 #42573869 未加载
mmwelt4 个月前
This all looks fine for developing server apps that don&#x27;t need a GUI, particularly as long as 3D accelerated graphics aren&#x27;t needed. You don&#x27;t even need to be using&#x2F;developing a 3D game or application, just using a modern GUI without too much lag now seems to require 3D acceleration.
评论 #42571099 未加载
crabbone4 个月前
But why tho?<p>The only kind of plausible explanation the author gives is that it&#x27;s &quot;more secure&quot; because the imaginary attacker will have to take an extra step to get the password from the VM instead of the host OS? -- This seems like such an inconsequential &#x2F; worthless benefit to jump through the hoops of running things in a VM...<p>Like... I wasn&#x27;t sold on this approach from the get go, and this pitch makes it sound like I was right all along?<p>Other non-starter &quot;bonuses&quot; include not installing developer tools on your laptop that you have for... drum roll... development. Why? It&#x27;s sole purpose is to be used for development, why not install development tools on it? Just doesn&#x27;t make any sense...
zokier4 个月前
I use similar setup on Windows (with vmware&#x2F;virtualbox&#x2F;hyper-v at different times), which kinda highlights one additional upside: it doesn&#x27;t matter that much what the host system is, you can do your work all the same regardless if it is macos&#x2F;windows (or even linux). As long as it can run the vm and vscode, you are good to go. Although admittedly Apple going with aarch64 throws a small wrench in the equation.<p>It is especially nice in corporate environment, where the host system is generally managed by IT and the devices are largely impersonal (standardized configuration, standardized software). You can carve out a corner to make your own and work there. &lt;insert rant on ineffective corporate IT&gt;
gbraad4 个月前
Consider using tailscale drives to expose certain folders using webdav. Have been doing this for de containers and VMs since it got demoted and since has replaced using winscp or other ways to share files
评论 #42576429 未加载
tkiolp44 个月前
Why does the author need a “remote ssh” plugin in their VSCode? I usually develop inside a VM as well, with my IDE running in the host… but what I do is to mount a shared directory for the code between the host and the VM. Works pretty fast.<p>Don’t understand the need for Tailscale either. When I’m running services or dbs inside the VM, I can easily access them if needed from the host (either by IP or by the hostname I gave to the VM on start up)
评论 #42570089 未加载
评论 #42570681 未加载
评论 #42575822 未加载
评论 #42570219 未加载
评论 #42570978 未加载
lizknope4 个月前
Are most companies this flexible in allowing developers to install whatever they want?<p>&gt; My physical machine is a 2023 MacBook Pro with M2 Pro CPU<p>&gt; I’m using VMWare Fusion Pro<p>&gt; Quite often I’ve found developers frowning up Ubuntu and preaching for folks to use NixOS, Arch, Debian or other distros. The reality for me was Ubuntu was the fastest way to get set up and now<p>I&#x27;m in integrated circuit &#x2F; semiconductor design. At every big company over the last 30 years we are given a computer and we can change the desktop environment but we aren&#x27;t installing our own operating system.<p>The people I know in software have a common OS, compiler, and build environment. They aren&#x27;t dictating what text editor you use but you aren&#x27;t working on projects individually but together.<p>So if everyone at the author&#x27;s company is doing their own thing do they have problems integrating all the code together? &quot;Oh you used version 2.3.4 but I used version 2.4.7 which fixed this issue, what are we using to ship with?&quot; Or is this not a problem?
评论 #42574976 未加载
评论 #42574186 未加载
sushidev4 个月前
Started using code-server on a remote server. Pretty good. Going to switch working like that. Its a bit like remote vscode only that the vscode ui is also remote and served via a web browser. Coming from intellij I was surprised that the user experience in terms of responsiveness is actually better with the remote setup. IntelliJ these days just lagging on everything.
raihansaputra4 个月前
Are you installing the project dependencies on the VM directly or in a docker container? I&#x27;m curious how well docker on top of the Ubuntu vm works. Orbstack is great for personal use, but some companies don&#x27;t want to pay for it, and this might be an alternative to have a better docker experience on macOS.
评论 #42572668 未加载
评论 #42573399 未加载
评论 #42571108 未加载
mrbluecoat4 个月前
If you like NixOs and virtual development environments, perhaps try <a href="https:&#x2F;&#x2F;www.jetify.com&#x2F;devbox" rel="nofollow">https:&#x2F;&#x2F;www.jetify.com&#x2F;devbox</a> or <a href="https:&#x2F;&#x2F;flox.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;flox.dev&#x2F;</a>
tonymet4 个月前
Windows 11 and WSL manages this well . For those developing linux apps &amp; containers using VS Code, you&#x27;ll find the Windows 11 experience to be very good. You can code against WSL which offers the more popular distros, or use HyperV to run your own custom VMs.
评论 #42570948 未加载
Too4 个月前
Any benefit of using a VM over docker container here? Since you seem to use the terminal only, without any graphical applications. Containers should be more lightweight and dockerfiles allow quick and reproducible changes to the guest OS.
评论 #42573821 未加载
arkh4 个月前
&gt; I’ve found developers frowning up Ubuntu and preaching for folks to use NixOS, Arch, Debian or other distros.<p>My setup is mostly one VM per project group &#x2F; online identity. Most of them using Ubuntu. The problem is when I want to work on an old project to check how it likes new technology I tend to stumble into the &quot;you should have kept the OS up to date&quot; problem. Ubuntu does not make it easy to upgrade if you miss more than a year of update.<p>And even if you keep up to date, they tend to break things often (loved the X11 to weyland switch when working with screen capture libraries) so new VMs are using debian.
评论 #42573655 未加载
nkko4 个月前
An alternative approach we&#x27;re working on is Daytona (<a href="https:&#x2F;&#x2F;github.com&#x2F;daytonaio&#x2F;daytona">https:&#x2F;&#x2F;github.com&#x2F;daytonaio&#x2F;daytona</a>) - it orchestrates dev environments on your infrastructure or even on your local machine. Oh, and it is Apache 2.0. The interesting bit is how it handles any IDE integration and various providers for running your dev envs on.<p>Disclosure: I work on this project
dsfsaff4 个月前
I have used a Virtual Box VM with a Ubuntu guest for years and it has worked great. It&#x27;s as close to the VM&#x27;s in prod you can get.
评论 #42569902 未加载
jareklupinski4 个月前
is there a way to forward usb&#x2F;serial ports from my local machine to the dev container?<p>maintaining consistent firmware development environments using containers is a great idea, and current solutions involving proxying the compiled binary work well for flashing quickly, but switching back and forth between UART and Serial Debug is always more convenient when the IDE can handle it all
评论 #42570423 未加载
评论 #42569843 未加载
评论 #42570346 未加载
评论 #42570074 未加载
pjmlp4 个月前
At work, development with VMs has been a given since the early days of Amazon EC2 in 2010.<p>Likewise when Windows 7 came out, I stop bothering with dual booting hassles and using VMare Workstation instead for whatever Linux.<p>The exception being a netbook from the Asus Linux netbooks glory days, a price category nowadays replaced by tablets.
amelius4 个月前
Beats developing inside a docker container.
评论 #42571127 未加载
rcarmo4 个月前
I use Proxmox on my LAN and RDP connections to Linux and Windows desktops of various kinds. It’s great.
secondcoming4 个月前
If you&#x27;re using a personal device for developing your employer&#x27;s code always use a VM. You can just nuke the whole thing when your employment ends and not have to worry about any of their IP remaining on your machine.
mootoday4 个月前
Pretty sure you&#x27;d have a more lightweight experience with <a href="https:&#x2F;&#x2F;www.jetify.com&#x2F;devbox" rel="nofollow">https:&#x2F;&#x2F;www.jetify.com&#x2F;devbox</a>.<p>Happy to set it up and demo if you can share (or DM) a repo URL.
评论 #42573052 未加载
firesteelrain4 个月前
We have been developing code inside VMs for over 15 years at my company with various flavors of VMware on the backend and lately more moving to Azure. I assumed this was normal.<p>We reach our VMs via VDI.
评论 #42573839 未加载
pshirshov4 个月前
I use Nix for exactly the same purpose (dependency management for code generators), that&#x27;s much more efficient and easier to maintain than VMs.
urronglol4 个月前
Devcontainers running as non root. Trivial t set up. Don’t need to fanny around with a Vm
评论 #42574184 未加载
hrtk4 个月前
Have you tried Lima?
TacticalCoder4 个月前
Curiosity: is anyone here developing inside a VM, with GPU passthrough, and with the monitor directly connected to the GPU used by the VM? (as in: showing the UI of the VM, without any need for RDP or the like)<p>Such a setup works (I&#x27;d know for I have one at home doing just that but it&#x27;s not my main PC) but how&#x27;s it like to work like that?<p>The GPU hooked to the hypervisor can either be on another monitor or on another input (in the latter case you&#x27;d &quot;go&quot; to the hypervisor by changing the monitor&#x27;s input).
评论 #42573956 未加载
评论 #42574061 未加载
tonymet4 个月前
For the rest of you, don&#x27;t be fooled by Darwin, it&#x27;s a dusty BSD in Linux clothing