Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Computer viking
May 30, 2011
Now with less breakage.

You could try synth? From memory, you do "synth configure" once, update ports (with portsnap or git or whatever), and then "synth upgrade-system" will replace anything older than the ports version, and everything that depends on it. Takes forever and a day unless you have a lot of cores, though.

Adbot
ADBOT LOVES YOU

DerekSmartymans
Feb 14, 2005

The
Copacetic
Ascetic

Computer viking posted:

Depending on your needs you may even be able to use windows native IDE to develop linux-native code inside WSL.

I’m 100% not a developer, but I thought that was the entire reason for Windows Terminal (instead of PowerShell) in the first place! I could be misunderstanding it, though, as it caught my eye enough to stick, but not to try and find it again while on my phone.

RFC2324
Jun 7, 2012

http 418

DerekSmartymans posted:

I’m 100% not a developer, but I thought that was the entire reason for Windows Terminal (instead of PowerShell) in the first place! I could be misunderstanding it, though, as it caught my eye enough to stick, but not to try and find it again while on my phone.

doesn't look like Windows Terminal is an "instead of powershell" thing. Its a program for running powershell(or cmd, or wsl) with a prettier interface

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Computer viking posted:

WSL with X forwarding - or WSLg, if you can get hold of it - may also be worth a shot?

Depending on your needs you may even be able to use windows native IDE to develop linux-native code inside WSL.

I had totally forgotten WSL was even a thing, and even if I did, it wouldn't have occurred to me it was this advanced. So I'll be trying to run this into the ground first and foremost. Heck, it looks like I should be able to use this on my home machine to do Linuxy stuff.

CaptainSarcastic
Jul 6, 2013



KozmoNaut posted:

The defaults in KDE are pretty solid IMO.

I'm not a huge fan of single click to open folders, and I prefer text alongside the icons for open windows in the taskbar, rather than just icons. Along with bumping up the animation speed a bit, that's about the extent of the tweaking I bother to do to KDE these days, about the same as I would do to Windows 10.

Pretty much same. Double-click to open folders, enable shade inactive windows, and my beloved wobbly windows. Throw on a decent theme and I'm done.

Computer viking
May 30, 2011
Now with less breakage.

RFC2324 posted:

doesn't look like Windows Terminal is an "instead of powershell" thing. Its a program for running powershell(or cmd, or wsl) with a prettier interface

Indeed - it's the equivalent of konsole or gnome terminal. It does have some integration with WSL, in that you can open a tab directly into a WSL shell, but it's sort of separate from the development tools. IIRC you can write code in VS and VS Code that compiles and runs inside WSL, and I think they have even integrated the VS debugger with it.

Rocko Bonaparte posted:

I had totally forgotten WSL was even a thing, and even if I did, it wouldn't have occurred to me it was this advanced. So I'll be trying to run this into the ground first and foremost. Heck, it looks like I should be able to use this on my home machine to do Linuxy stuff.

That is kind of what it's for, yes. WSLg is an expansion they are finishing right now: It does some weirdness with a linux driver, a wayland server on the linux side, and an MS-written wayland server for Windows to let you run graphical linux applications on Windows. They even show up in the start menu, I believe. I haven't tried it yet, and I think it's still a little bit finicky to get access to it - but it should eventually become a standard part of WSL.

And no I don't know if this is a good or bad thing for the Linux ecosystem.

Computer viking fucked around with this message at 10:59 on Aug 4, 2021

BlankSystemDaemon
Mar 13, 2009




Paul MaudDib posted:

Hey, so, when I'm doing a clean install of a FreeBSD system that's a while after release, when I go to upgrade ports there is often a lot of changes from the baseline ports on the install media. Sometimes this results in incompatibility - one typical scenario is that there's a security update that "locks" an old port out, however, if I go to rebuild the port, it's in conflict with some other existing package I've compiled.

(ffmpeg seems to be a particularly bad offender here since compiling it tends to install a lot of ports dependencies for various media packages, some of which want to install x11 or postscript/libcairo and then the cat is out of the bag, there's all kinds of stuff being compiled - is there any kind of efficient way to manage this in terms of getting some idea of downstream dependencies for various compile options? like on a fileserver I see no reason to install X11 and would specifically want to exclude any options that require that.)

I'd have to find the source again, I think it was a post on the freebsd forums. the way they did it was basically to dump a list of all installed ports, delete the userland down to just some core set of apps, then feed the list of installed ports back to portmaster and have it rebuild everything (on the new ports tree). is that the easiest way to do it?

is there a way to do this with zfs snapshots or chroot or something where I can have the userland stay there for other applications, but rebuild into a new tree that I can swap in when it's fully built? Is it possible to do that on a live system, or do you have to do a restart when you swap the userland?
I don't know of anyone who's using the ports shipped on the install media, as it's only a fraction (~1000) out of the total (~45000) ports

Is there a reason you're using ports over packages, if you're not doing custom-built options? Because the main advantage of ports is the ability to throw OPTIONS_UNSET="X11 FONTCONFIG" in make.conf(5).

To me, the easiest way of building things is using poudriere - it can build both FreeBSD base system, as well as ports, and it respects make.conf (and can do per-tuple-target custom make.conf files).

As far as doing it via zfs snapshots, poudriere can build images (ie. a full FreeBSD install image) that can include third-party software, and it can package as a zfs-snapshot using poudriere-image(8).

Worf
Sep 12, 2017

If only Seth would love me like I love him!

is the thread title probably the answer to the dual boot question i was gonna ask?

BlankSystemDaemon
Mar 13, 2009




It's been ages since I've done it, but if memory serves the best way is to let NTLDR chainload whatever it is you want to get into, because Windows updates will override your boot block arbitrarily.

DerekSmartymans
Feb 14, 2005

The
Copacetic
Ascetic

RFC2324 posted:

doesn't look like Windows Terminal is an "instead of powershell" thing. Its a program for running powershell(or cmd, or wsl) with a prettier interface

That makes perfect sense, I had just seen a video about running Linux-native programs from Windows Terminal without even booting/VM an actual Linux environment. The YouTuber (Liron Segev or Chris Titus Tech, don’t remember which) mentioned it in passing during a video and I could certainly be wrong with how I understood it!

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

BlankSystemDaemon posted:

It's been ages since I've done it, but if memory serves the best way is to let NTLDR chainload whatever it is you want to get into, because Windows updates will override your boot block arbitrarily.

Not really the case anymore since UEFI, but Windows will still love to gently caress with your stuff.

The best way is to give Windows its own whole drive to gently caress with and install it normally, then install Linux to another drive, set EFI to boot from Linux's ESP, and let grub2's os-prober (usually shipped by default) automatically detect the Windows boot entry.

That way Windows will usually leave your stuff alone.

Worf
Sep 12, 2017

If only Seth would love me like I love him!

will a different partition suffice or do you mean physical drive?

in my case this is on an xps13 9360 so i only have one drive slot.

i may not bother with dual boot honestly since the likelihood of me ever using this thing for a game or whatever is approaching 0, in all reality

i guess i asked more as a safety blanket rather than because i need windows still- especially if theres a chance windows does some hostile takeover poo poo

Worf fucked around with this message at 15:46 on Aug 4, 2021

RFC2324
Jun 7, 2012

http 418

Statutory Ape posted:

will a different partition suffice or do you mean physical drive?

in my case this is on an xps13 9360 so i only have one drive slot.

i may not bother with dual boot honestly since the likelihood of me ever using this thing for a game or whatever is approaching 0, in all reality

i guess i asked more as a safety blanket rather than because i need windows still- especially if theres a chance windows does some hostile takeover poo poo

Hostile takeover poo poo?

What company are they going to take over?

And yeah, if they are on the same physical drive windows will constantly try to take over the boot loader, and that doesn't work for dual boot

The Gadfly
Sep 23, 2012
Yes, it's safest to use separate drives for dual boot with Windows. One drive for your main OS, and one drive for :toxx:

To set it up, just follow the dual boot section of the guide/wiki for your distro. It's generally recommended to set up Windows first to ensure that the Windows installation doesn't overwrite anything.

Worf
Sep 12, 2017

If only Seth would love me like I love him!

I guess this is probably why last time I did this on that computer I was using it off of a USB drive. I dont like that for regular use, even if it is very cute and convenient for other uses

On that topic, just in theory, if I partitioned the 1 drive i have on that laptop into 2, one with windows boot and the other was a data drive, the any OS on the USB could use that partition for data?

I would basically just be bound to whatever thermal and i/o speed limitations on the usb for the OS, aside from the nodule sticking out?

RFC2324
Jun 7, 2012

http 418

I really want to know what you meant by MS pulling a hostile takeover, tbh, because it seemed like you think MS can take over a bunch nerds writing lovely code in their free time.

I need a good laugh today

BaseballPCHiker
Jan 16, 2006

Ive now been running my home built desktop with mint for over a year and its fantastic. Its nothing special. Just an AMD Ryzen 5 3600 with 16 gigs of RAM and a Radeon RX 580.

I'm not much of a gamer. It runs Civ 6 and Out Of The Park baseball just fine. The couple of windows apps I need to run work just fine with WINE. Web stuff works great which is 90% of what I do. Ive had the occasional sound issue and just 1 crash in a year, otherwise its been perfect.

So for anyone interested in making the leap I would say go for it! I'll never run Windows at home again.

Saukkis
May 16, 2003

Unless I'm on the inside curve pointing straight at oncoming traffic the high beams stay on and I laugh at your puny protest flashes.
I am Most Important Man. Most Important Man in the World.
I've been dualbooting on an old laptop and it seems to have been working, until Windows refuses to upgrade to 21H1.

I think my method was to first create a single partition that fills the whole drive and then boot the Windows installer. This prevents Windows from creating those little boot and recovery partitions which complicate things unnecessarily. After Windows has finished installing reduce the size of this partition and start the Linux installation. Install Linux on a partition after the Windows partition, set this Linux partition and bootable and install Grub on this partition instead of MBR. This seems to prevent Windows from messing things up.

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
Unless you need hardware acceleration running Windows in a VM is much better for running Windows-exclusive garbage applications, FWIW.

I wouldn't screw around with dual boot setups unless you need to use a GPU.

No, don't try vfio poo poo, it's tedious janitoring.

Matt Zerella
Oct 7, 2002

Norris'es are back baby. It's good again. Awoouu (fox Howl)
Also if you don't like Virtualbox, you can get VMware Workstation Pro licenses from SA mart for cheap and they work fine on Linux.

I'm using it on a NUC running Centos7 for vagrant testing and it works great (also HashiCorp recently stopped charging for the VMware plugin/support on vagrant so its now just as good as virtual box).

xzzy
Mar 5, 2009

RFC2324 posted:

I really want to know what you meant by MS pulling a hostile takeover, tbh, because it seemed like you think MS can take over a bunch nerds writing lovely code in their free time.

I need a good laugh today

It was a joke about the Windows install process breaking the gently caress out of any boot loader Linux installed.

RFC2324
Jun 7, 2012

http 418

xzzy posted:

It was a joke about the Windows install process breaking the gently caress out of any boot loader Linux installed.

oh lmao

I'm so used to the business sense that started it all I didn't think about alternate uses :v:

Worf
Sep 12, 2017

If only Seth would love me like I love him!

i'm glad that autoresolved

Computer viking
May 30, 2011
Now with less breakage.

DerekSmartymans posted:

That makes perfect sense, I had just seen a video about running Linux-native programs from Windows Terminal without even booting/VM an actual Linux environment. The YouTuber (Liron Segev or Chris Titus Tech, don’t remember which) mentioned it in passing during a video and I could certainly be wrong with how I understood it!

Just to clarify:
Windows 10 and 11 have something called WSL - which is really two different systems, WSL1 and WSL2.

WSL1 is effectively a slighly modernised version of the old Services For UNIX / Interix, and is spiritually similar to the Linuxolator on FreeBSD: It's what MS calls a "personality" for the NT kernel (Win32 is apparently also a personality). In non-MS speak, that means it's a translation layer between NT syscalls and Linux syscalls: it allows the windows kernel pretend to be a linux kernel.
WSL2 is a Hyper-V based system that boots an actual Linux kernel and has that running over in a corner - effectively using Hyper-V as the translation layer between the OSes instead.
MS has admitted that there are some things that are way faster in one or the other, so both will remain available for the foreseeable future, and you can swap between then easily.

In practice, they provide a fairly similar experience: You can install a linux distro from the MS Store (or an offline installer, though those are a bit harder to find). It installs into a directory tree somewhere in your profile, using some sort of magical mystery translation to map between NTFS and what linux expects from a file system. You can then start a linux shell from in there, and it will run the actual /bin/bash binary, with the help of some glue code to load and start linux ELF binaries.When it does syscalls, it talks to either the NT kernel (WSL1) or the HyperV linux kernel (WSL2). It's a full, nearly unchanged, linux distro, so you can install packages and whatever; you can use as much memory and as many CPU cores as a windows program, and you can mount windows drive letters into directories.

If you just need to run some command line Linux tools now and then, it's a lot nicer than setting up a VM.

DerekSmartymans
Feb 14, 2005

The
Copacetic
Ascetic

Computer viking posted:

Just to clarify:
Windows 10 and 11 have something called WSL - which is really two different systems, WSL1 and WSL2.

WSL1 is effectively a slighly modernised version of the old Services For UNIX / Interix, and is spiritually similar to the Linuxolator on FreeBSD: It's what MS calls a "personality" for the NT kernel (Win32 is apparently also a personality). In non-MS speak, that means it's a translation layer between NT syscalls and Linux syscalls: it allows the windows kernel pretend to be a linux kernel.
WSL2 is a Hyper-V based system that boots an actual Linux kernel and has that running over in a corner - effectively using Hyper-V as the translation layer between the OSes instead.
MS has admitted that there are some things that are way faster in one or the other, so both will remain available for the foreseeable future, and you can swap between then easily.

In practice, they provide a fairly similar experience: You can install a linux distro from the MS Store (or an offline installer, though those are a bit harder to find). It installs into a directory tree somewhere in your profile, using some sort of magical mystery translation to map between NTFS and what linux expects from a file system. You can then start a linux shell from in there, and it will run the actual /bin/bash binary, with the help of some glue code to load and start linux ELF binaries.When it does syscalls, it talks to either the NT kernel (WSL1) or the HyperV linux kernel (WSL2). It's a full, nearly unchanged, linux distro, so you can install packages and whatever; you can use as much memory and as many CPU cores as a windows program, and you can mount windows drive letters into directories.

If you just need to run some command line Linux tools now and then, it's a lot nicer than setting up a VM.

Thank you for spelling it out. The very last paragraph is what I saw on YouTube and was referring to. Some tools (especially CL tools) are just out-and-out better on Linux.
I have seen that most gaming these days is possible on Linux with right software, but I don’t think I’ll ever completely wean from Win10/Win11 because I am usually just wanting to install/patch/play my pc games without doing a lot of setups and configurations. I’m the lazy Microsoft gaming peon they know is good for a few :10bux: every month or so.

xzzy
Mar 5, 2009

The one big is usability annoyance I found that differentiates WSL and WSL2 is that with WSL2 being a VM, it has its own IP address and that comes with all the networking quirks you can think of.

The most upfront issue will be getting X11 working, you have to open ports in windows defender firewall and managing that thing sucks. It doesn't help that all the google results will just tell you to open the X11 ports to everything (including the public interface) which is a hilarious no-no.

Mr. Crow
May 22, 2008

Snap City mayor for life
Just use virtual box if you need a full blown Linux machine, WSL1/2 STILL have to many stupid gotchas between themselves and the host Windows system. And with virtualbox you can actually snapshot/clone etc to your hearts content.

If you just need some coreutils and not-PowerShell mingw via git bash is infinitely more convenient and useable.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Computer viking posted:

That is kind of what it's for, yes. WSLg is an expansion they are finishing right now: It does some weirdness with a linux driver, a wayland server on the linux side, and an MS-written wayland server for Windows to let you run graphical linux applications on Windows. They even show up in the start menu, I believe. I haven't tried it yet, and I think it's still a little bit finicky to get access to it - but it should eventually become a standard part of WSL.

Is WSLg and WSL2 different?

I had a lot of trouble getting it to work with KDE with WSL1. I guess I should say nobody told me to do that, but I decided to take two separate recommendations and put them together in a way nobody had recommended. I was trying to get a standalone KDE desktop to come up and it just wouldn't.

In the realm of desktop environments, I was hoping to try KDE for awhile and get into its internals while I was simultaneously using it locally on my Windows machine at work. I don't actually need KDE having a local environment, but it looked like I could kill two birds with one stone. Instead I did the normal thing where I tried to get XFCE4 to install, and it did just fine. I might be pre-programmed to use that environment because it's the only one I can consistently get to behave. It must be some pheromone I secrete or something.

I saw a lot more tutorials to get KDE up with WSL2, but my work laptop isn't using a new enough Win10 build, and it looks like they suppressed my ability to update to run it. I couldn't gauge the culture of KDE with WSL to tell if everybody moved on to WSL2, but I can tell all the WSL1 stuff is getting a few years old and wasn't as directly applicable any more.

RFC2324
Jun 7, 2012

http 418

Rocko Bonaparte posted:

Is WSLg and WSL2 different?

I had a lot of trouble getting it to work with KDE with WSL1. I guess I should say nobody told me to do that, but I decided to take two separate recommendations and put them together in a way nobody had recommended. I was trying to get a standalone KDE desktop to come up and it just wouldn't.

In the realm of desktop environments, I was hoping to try KDE for awhile and get into its internals while I was simultaneously using it locally on my Windows machine at work. I don't actually need KDE having a local environment, but it looked like I could kill two birds with one stone. Instead I did the normal thing where I tried to get XFCE4 to install, and it did just fine. I might be pre-programmed to use that environment because it's the only one I can consistently get to behave. It must be some pheromone I secrete or something.

I saw a lot more tutorials to get KDE up with WSL2, but my work laptop isn't using a new enough Win10 build, and it looks like they suppressed my ability to update to run it. I couldn't gauge the culture of KDE with WSL to tell if everybody moved on to WSL2, but I can tell all the WSL1 stuff is getting a few years old and wasn't as directly applicable any more.

to get basically anything to work in WSL1 you need to do some magic to bypass dbus, unless they recently changed something. XFCE is basic enough I don't think it uses it tho

E: https://www.reddit.com/r/bashonubuntuonwindows/comments/9lpc0o/ubuntu_1804_dbus_fix_instructions_with/ I think thats gonna be what needs to happen, but its been a while since I made it work

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

RFC2324 posted:

to get basically anything to work in WSL1 you need to do some magic to bypass dbus, unless they recently changed something. XFCE is basic enough I don't think it uses it tho

E: https://www.reddit.com/r/bashonubuntuonwindows/comments/9lpc0o/ubuntu_1804_dbus_fix_instructions_with/ I think thats gonna be what needs to happen, but its been a while since I made it work

Yeah I'll try. I was getting some bad vibes from dbus. I know I did the basic stuff but there was some more troubleshooting in there.

Computer viking
May 30, 2011
Now with less breakage.

If your windows is too old for WSL2, it's definitely way too old for WSLg, which is still "maybe you'll get it over windows update if you wish upon a star" territory right now. I have no idea if you can combine WSL1 and WSLg, though - I'll have to try sometime.

As for usability of WSL compared to a VM, it depends. Networking, especially in WSL2, is weird. For pure command line stuff, being able to just run linux tools directly on my windows files (and indeed the other way), and being able to just open another terminal tab into a linux shell, is super convenient. I can absolutely imagine uses where VMware fits better, but for me it'd just be a lot more faff.

BlankSystemDaemon
Mar 13, 2009




The main benefit of how Linuxulator and WSL1 works is that the host kernel and userland can see and interact with the processes - meaning not only can you see them in ps or Windows task manger / process explorer, you can also attach a debugger to it, and do all sorts of other things like instrument it for tracing with dtrace (which exists on both platforms).

Another benefit is that you're free to choose whether or not it should be isolated - for example on FreeBSD you can put Linuxulator in a jail, so that you still get all of the above benefit, but the Linux ELF executable doesn't have any real clue it's running on a FreeBSD system unless it's designed to figure that out.

Vavrek
Mar 2, 2013

I like your style hombre, but this is no laughing matter. Assault on a police officer. Theft of police property. Illegal possession of a firearm. FIVE counts of attempted murder. That comes to... 29 dollars and 40 cents. Cash, cheque, or credit card?

Rocko Bonaparte posted:

I decided to take two separate recommendations and put them together in a way nobody had recommended.

Too long for a thread title, but perfect otherwise.

BlankSystemDaemon
Mar 13, 2009




Is "Take two recommendations and put them together in a way nobody recommends" too long? Because it's pretty much perfect in every way.

It can even be shortened to "Take two ideas and put them together in a way nobody suggests".

Methanar
Sep 26, 2013

by the sex ghost
Two good ideas combined into one bad idea

xzzy
Mar 5, 2009

why use one fix when two fix do trick

BlankSystemDaemon
Mar 13, 2009




Methanar posted:

Two good ideas combined into one bad idea
I'd argue there's plenty of instances where the recommendations are bad ideas, but that doesn't stop them from being practiced by rote and hailed as ways to appease the elder gods from people who don't understand how to read manual pages and need to copy/paste everything.

rufius
Feb 27, 2011

Clear alcohols are for rich women on diets.

xzzy posted:

why use one fix when two fix do trick

:ck5:

unimportantguy
Dec 25, 2012

Hey, Johnny, what's a "shitpost"?
The Linux Questions Thread: there's plenty of instances where the recommendations are bad ideas is probably too long isn't it

Adbot
ADBOT LOVES YOU

xzzy
Mar 5, 2009

Anyone know of a bash trick with redirects or pipes to zero out a file before writing the latest line of output?

To be more specific, I'm doing a big rsync and using --info=progress2 to get an estimate of how far along it is. By redirecting to a file (or using tee, or cat) like normal the output file grows as rsync produces output. I want a second process to "do stuff" with this output and while I guess doing 'tail -1' is the traditional way to do it, it got me wondering if there was a way to zero out a file before each write.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply