back to article Want to spin up Ubuntu VMs from Windows 10's command line, eh? We'll need to see a Multipass

Windows 10 developers have been gifted yet another way of running Linux on their desktop in the form of Canonical's Multipass. Users of Microsoft's OS have been spoiled for choice as the software maker has sought to persuade developers that these days it prefers to snuggle up to rather than stomp on penguin-based life. …

  1. Anonymous Coward
    Anonymous Coward

    "Want to spin up Ubuntu VMs from Windows 10's command line?" - God no! That sounds horrible! I want to start in Linux and end in Linux. I don't care what distro.

    1. Persona

      As the article says it's aimed at the corporate environment where you have to have a Windows PC on your desk. You can then have 1 core of the CPU running Windows for the PC only apps your employer mandates. The other CPU's on the PC then give you the development environment you need.

    2. malle-herbert Silver badge
      Big Brother

      Looks like the NSA is really desperate to find out what the penguin-people are up to !

    3. Jason Bloomberg Silver badge
      Thumb Up

      I want to start in Linux and end in Linux

      Then this is not for you. However not everyone wants to start in Linux and end in Linux nor has the luxury of being able to do so.

      I can understand how some Penguinistas aren't happy about Windows still keeping its foot in the door but that's the reality of how things are. I primarily develop for Windows as that's the bigger market for what my company produces but we also support Linux and WSL has been a real boon in assisting with that. And Multipass may help some more.

      1. brym

        I prefer the opposite: running win10 vm's on Linux. But it's good that MS is putting the effort in.

        1. Richard Plinston Silver badge

          > But it's good that MS is putting the effort in.

          I did not see anywhere that this was being done by Microsoft at all. In fact the article calls this "Canonical's Multipass", as indeed it seems to be entirely Canonical's effort. Following the beta link shows there is also a Mac version.

          1. brym

            I don't follow, are you for or against better collaboration?

  2. naive

    I love WSL, since it made scripting on Windows usable after 30 years :)

    WSL can also use Windows *.exe files.

    /mnt/c/Windows/System32/systeminfo.exe | grep -i "System boot" | awk '{print $4}' | sed 's/,//'

    10-1-2019

    The elegance and simplicity of bash scripting is hard to beat.

    Try that in PowerShell.

    1. Spoonsinger

      Re: Try that in PowerShell.

      The term '/mnt/c/Windows/System32/systeminfo.exe' is not recognized as the name of a cmdlet, function, script file, oroperable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

      At line:1 char:39+ /mnt/c/Windows/System32/systeminfo.exe <<<< | grep -i "System boot" | awk '{print $4}' | sed 's/,//' + CategoryInfo : ObjectNotFound: (/mnt/c/Windows/System32/systeminfo.exe:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

      All looiks good to me :-)

    2. katrinab Silver badge

      Re: I love WSL, since it made scripting on Windows usable after 30 years :)

      What's wrong with "last reboot"?

      Tested on tcsh in FreeBSD, but I believe it works in Bash/GNU/Linux as well.

    3. barstewardsquad
      Coat

      Re: I love WSL, since it made scripting on Windows usable after 30 years :)

      There are probably simpler and more elegant ways but this works for me.

      date([management.managementdatetimeconverter]::ToDateTime((Get-WmiObject win32_operatingsystem).LastBootUpTime)) -Format dd-M-yyyy

      I would normally do the date as yyyyMMdd but wanted to match it to the OP's format.

      Mine is the one with a windows VM on linux because Azure modules don't work properly on Linux Powershell

      1. doublelayer

        Re: I love WSL, since it made scripting on Windows usable after 30 years :)

        Powershell is nice and powerful, it can do a lot of the scripting things that CMD couldn't do before, but could they make the commands shorter? When I've written PS code, I've either ended up with monstrous lines of code to run a few commands or I store everything (really everything) in a bunch of confusingly-named temporary variables in the interest of readability. I know you can have long and terrible lines in shell scripts too, but they're less common in my experience.

        1. Anonymous Coward
          Anonymous Coward

          Re: I love WSL, since it made scripting on Windows usable after 30 years :)

          The name is a lie.

        2. phuzz Silver badge

          Re: I love WSL, since it made scripting on Windows usable after 30 years :)

          You can use aliases in pretty much the same way as you would on Linux, but yes, by default the command names are verbose.

          Perhaps the Windows devs still haven't calmed down from finally being able to use more than 8.3 filenames?

      2. GidaBrasti
        Coffee/keyboard

        Re: I love WSL, since it made scripting on Windows usable after 30 years :)

        Is that your definition of "simple" and "elegant"?

        Boy, are you desperate.

        Icon because if you goon typing all of that fluff all the time you are going to need a new keyboard real soon now.

    4. Anonymous Coward
      Anonymous Coward

      Re: I love WSL, since it made scripting on Windows usable after 30 years :)

      $(Get-CimInstance -ClassName win32_operatingsystem).lastbootuptime | get-date -format d

      Which gives you (as a date-time object):

      1/22/2019

      Or, I can use systeminfo, grab the line I want, split it and pick out the bit I want from that:

      $(systeminfo.exe | Select-String "System Boot Time" | out-string).Split(" ,")[12]

      1/22/2019

      (Computer is in US, so date format is wrong).

    5. stungebag

      Re: I love WSL, since it made scripting on Windows usable after 30 years :)

      This is clearly some new meaning of the word 'elegant'.

    6. phuzz Silver badge

      Re: I love WSL, since it made scripting on Windows usable after 30 years :)

      Try that in PowerShell.

      Ok then:

      Get-CimInstance -ClassName win32_operatingsystem | select lastbootuptime

      (Note how instead of having to manipulate strings using multiple programs, we just grab the one field we're interested in, which is returned as a DateTime so we don't have to reformat it if we wanted to use it in a script.)

  3. Velv Silver badge

    Somebody had to...

    Multipass

    1. Aladdin Sane Silver badge

      Re: Somebody had to...

      None shall pass

    2. Alistair Silver badge
      Windows

      Re: Somebody had to...

      @Velv:

      I was hoping that perhaps MS had decided to have Leelo demonstrate the new feature. Live. On stage. Somewhere up here in Canuckistan.

    3. Walter Bishop Silver badge

      Re: Somebody had to...

      Haaarrh :]

      Multipass

      1. This post has been deleted by its author

  4. RuffianXion

    Webservers?

    Quick question to all of you. Would I be able to use one of these Ubuntu VMs to operate a LAMP web server from my WIn10 desktop? It wouldn't need to be always on as I'd only use it for testing websites in development and enabling clients to view WIP sites. I currently use a repurposed old E-Machines PC as my test server, but it would be nice to not have to have a separate box.

    1. katrinab Silver badge

      Re: Webservers?

      I think so, but you can install your distro of choice on Hyper-V and administer it via ssh anyway. That would definitely work, and you could chose something other than Ubuntu if you prefer.

    2. Anonymous Coward
      Anonymous Coward

      Re: Webservers?

      "Would I be able to use one of these Ubuntu VMs to operate a LAMP web server from my WIn10 desktop?"

      Currently doing this with Virtual Box + Ubuntu Server (VM), so can't see any reason it wouldn't work with a different virtualisation platform.

    3. ChrisElvidge

      Re: Webservers?

      Tried cygwin?

    4. naive

      Re: Webservers?

      With the default WSL it is simple:

      apt-get update

      apt-get install apache2

      Add website in the apache configuration.

      service apache2 start

      Before using apt-get, it maybe necessary to set the proxy

      export http_proxy=http://<addres>:port

      export https_proxy=http://<addres>:port

      Maybe Windows firewall may have to be setup to allowing incoming port 80/443 traffic.

      1. katrinab Silver badge

        Re: Webservers?

        Also, you need to do some stuff in Windows to get a Linux service to start - details here

        https://dev.to/ironfroggy/wsl-tips-starting-linux-background-services-on-windows-login-3o98

    5. horse of a different color

      Re: Webservers?

      e-Machines?!? What year is this?

      1. doublelayer

        Re: Webservers?

        Quick answer: yes.

        Long question: Why? You could run any OS with webserver in your VM solution of choice. You could exactly virtualize your server environment and share the network connection, thus having local access. If it is a server you don't mind setting up, you could also run apache and any other dependencies (definitely MySQL and PHP but a lot of other tools are supported) directly on windows. I've done it*, and setup is very fast and it works the same unless you have some specifically Linux backends.

        *We needed an internal server. They put the windows image on a machine and put it somewhere I couldn't change it. What was I going to do?

        1. 000whacksplat

          Re: Webservers?

          I’m an engineer for a large enterprise cloud backup and recovery platform. Before this project I had never seen much beyond the basic VM setups. But our customers have some very cool and imaginative VM configurations. Trying to figure out how to support backing all of this data up on the guest and host levels to allow for everything from a single file revision recovery to a bare metal recovery has taught me so much about what can be done with VMs. (It has also taught me that VMware makes strong people openly weep.)

      2. katrinab Silver badge

        Re: Webservers?

        I’m sure it is just fine for what it needs to do. I have a 9yo Proliant Microserver which definitely wasn’t the fastest around when I bought it. It’s fine, except that it only has a VGA monitor port, and I’d like to throw out the old monitor I keep in the cupboard in case I am unable to connect to it remotely.

        1. Kiwi Silver badge
          Boffin

          Re: Webservers?

          There are VGA-HDMI and VGA-DVI converters available :)

          (How well they work with much older hardware I don't know)

          1. katrinab Silver badge

            Re: Webservers?

            Bear in mind that the monitor port only gets used if the server fails to boot up, so anything that needs drivers, forget it.

            1. Anonymous Coward
              Anonymous Coward

              Re: Webservers?

              VGA to HDMI / DVI, need no drivers, only a monitor that has analogue HDMI/DVI input pins (if its got all the pins it should work)

        2. Smoking Man

          Re: Webservers?

          I remember a customer engineer connecting hist notebook to a server vga (and keyboard/mouse) port with this device:

          https://www.startech.com/Server-Management/KVM-Switches/Portable-USB-PS-2-KVM-Console-Adapter-for-Notebook-PCs~NOTECONS01

          Enables a laptop to act as a KVM device. Nice and useful gimmick, just not the cheapest one.

      3. I3N
        Pint

        Re: Webservers? - Year is ....

        2011 ... that's what I spent the weekend learning how to make a VM believe it was ...

        some cmd scripting was involved ... didn't write it, but spent the time to figure out how and what it did ...

        Great comments here ... more to think about ....

    6. stungebag

      Re: Webservers?

      I've got several LAMP VMs on an external SSD that I do web development on in Hyper-V. No special distros or integration needed. I use FTP to get stuff in and out and the Linux console where necessary. A much cleaner solution than running the servers directly on your Windows box.

      Hyper-V makes it very easy to open several simultaneous consoles and, with snapshots, you can work on several parallel projects on the same VM.

      I find Hyper-V works well, but there's always Dropbox if you prefer.

  5. Anonymous Coward
    Anonymous Coward

    Nothingburger

    This doesn't look like a big advance over using az-cli on WSL or even in a VirtualBox or VMware VM (Hyper-V crashes my company provided Win 10 machine, which I'd like to blame on the usual corporate controlled ecosystem being predictably behind by several builds, but have also experienced in both the latest stable and previews on our home systems -- Hyper-V is just NRFPT on the desktop). Of course both stumble badly over the Windows filesystem when their userlands have to interact directly with files "on the other side", as they lack the compensating bits available in free tools like Git for Windows. But maybe that's just my tied-to-Windows-by-corporate-decree workflow. Not that it really matters, only a select few Windows admins have access to our Azure account anyway, and I doubt they'd know a container if it bit them on the a**. Not blaming them really, it's MS that rolled out an accounts platform that assumes everyone who uses it can sign up with their own Corporate Card and rack up $100's in service charges a day _while in development_. Then they wonder why AWS is still eating their lunch.

  6. Doctor Syntax Silver badge

    "Windows 10 developers have been gifted yet another way of running Linux on their desktop in the form of Canonical's Multipass."

    Yet another way? The old one is still the best.

  7. This post has been deleted by its author

  8. W. Anderson

    backward concept

    The clear case has never been made for installing Linux or a Linux subsystem "inside" Windows 10 as the convoluted process as described above leaves everything to be desired.

    On the other hand, installing Linux as a "dual boot" in it's own parttion on a Windows 10 computer has proven to be simpler and significantly more efficient and reliable than the nonsense explained in this article.

    The whole concept of Linux "inside" Windows is cogently noted by statement from an IBM Fellow some years ago as (paraphrasing) "building a stone or brick house (Libux) on a wood or twigs foundation (Windows). Nonsensical in it's core precept".

    Windows only users certainly need to get a life.

    1. Teiwaz Silver badge

      Re: backward concept

      Another way of running 'Linux on Windows......

      It just seems to me to be another example as to how the world in general has everything ass-backwards.

      OK, I don't use Windows an awful lot, but when I do, I seem to be put through at least a reboot or two before I can start, and one other during the course of the day, for one reason or another.

  9. TiddlyPom
    Facepalm

    Why use Hyper-V or even Windows for that matter?

    Alternatively you could run VMs in VirtualBox (on Windows) and not bother with Hyper-V at all or you could install Docker for Windows and use containers instead. Even better you could not bother with Windows at all, run a Linux distribution as your main OS (Linux Mint, Ubuntu, Fedora, openSUSE - have a look at DistroWatch for ideas) and run Windows as a VM when you have to and use KVM (which is more efficient than either Hyper-V or VirtualBox). I have been running Linux as my main OS for over a decade now and would never look back. Not for everybody but works for me.

    1. cdegroot

      Re: Why use Hyper-V or even Windows for that matter?

      Docker for Windows/Mac (it really doesn't matter) is super slow. Comparable with WSL - disk access is emulated and that just puts the handbrake on things. I've tried various approaches for developing on my Win10 laptop (because games, Lightroom, and so on), and I settled on running a full-screen Linux under Hyper/V on a second virtual desktop. It's very fast.

      I don't think KVM is more efficient than Hyper-V - both are, AFAIK, hypervisors rather than oldskool virtualization engines and performance should be ballpark the same. Whether you boot Win10 or Linux first shouldn't make too much difference because from the point of view of the hypervisor it ends up being just another client OS and Linux-under-Hyper-V-under-Windows and Windows-under-KVM-under-Linux both have a root hypervisor and then two OSes running underneath that. At least, that's what I understood about this whole business when I last checked how stuff worked :-)

      Back on topic: I really don't like Hyper-V's management UI, so this will hopefully help.

  10. cmaurand

    I see all your points, but ...

    I have two solutions in place. I have a windows machine running virtualbox. commandline, folder sharing, gui, etc. I've been using it for years. so to multipass...yawn. The second solution is a small machine that is running Ubuntu 18.04 LTS with KVM installed. I have Windows installed in a virtual machine for whatever I might need out of Windows. None of my old copies of Office will activate any longer, but OpenOffice and LibreOffice fill that void along with Thunderbird for email. I'm not in want. I have an app for my Canon DSLR which will only run on Windows or Mac so that's why the virtual. The only thing that doesn't work on Linux is Spectrum''s flash app that it uses for it's streaming service. I'm not missing anything there.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019