Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

[OT] Windows VMs under Linux for running Perl.

by BrowserUk (Patriarch)
on Dec 17, 2016 at 21:16 UTC ( [id://1177993]=perlquestion: print w/replies, xml ) Need Help??

BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone here use Windows interactively -- editors, command line etc. -- within a Windows VM hosted on Linux?

What I'm looking for is knowledge of actual interactive use of this environment for developing Perl code. Limitations; best combinations of Linux, VM and Windows versions; etc.

Any relevant guidance or knowledge, or pointers to same. Thanks.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on [OT] Windows VMs under Linux for running Perl.

Replies are listed 'Best First'.
Re: [OT] Windows VMs under Linux for running Perl.
by duelafn (Parson) on Dec 17, 2016 at 22:50 UTC

    I use Windows in a VM on Linux a lot. We have some old vb6 code that I get to maintain (lucky me). I run winXP in KVM/QEMU (Debian package qemu-kvm). Example command-line (kvm manpage):

    truncate -s 50G winXP.img # create an image kvm -hda winXP.img -m 2048 -monitor stdio -net nic,model=rtl8139 -net +user -usb -cdrom /dev/cdrom

    I run a samba share on the host (10.0.2.2 by default) for sharing files between host and VM. Never had any problem with speed or reliability of the VM or the file sharing.

    I keep my images as plain "raw" images (which will generally be sparse in Linux) so that I can occasionally re-sparse them using partclone and ddrescue when they get too big. If you use the qcow2 file format, the files will keep growing to the size of the virtual disk since TRIM isn't handled by the VM filesystem code (I believe this is still true; though it wouldn't be issued by winXP anyway).

    I also will often use a temporary image with a "backing file". The temporary image will only store files changed (so is quick to create and doesn't get too large) and the backing file will not be modified. The temporary file should be in qcow2 format. After setting up winXP.img, you can try out experimental stuff using (qemu-img manpage):

    qemu-img create -b winXP.img -f qcow2 temp.img kvm -hda temp.img ... rm -f temp.img

    Update: punctuation and minor wording

    Good Day,
        Dean

      Thank you! That's exactly the type of information -- and more -- that I was hoping for.

      A lot of the information you've given is over my head at the moment, but it gives me a great starting place for things I need to look up and understand before I start doing this. Thanks.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re: [OT] Windows VMs under Linux for running Perl.
by salva (Canon) on Dec 18, 2016 at 11:41 UTC
    I use VirtualBox for that, and hardly notice any difference with a bare-metal installation of Windows.

    Something I really like is mounting my Linux home directory as a drive in Windows (i.e. Y:), and then being able to develop on one OS and run the software in both without having to move things back and forward between then.

    Another handy thing is running Windows full screen in a Virtual desktop and being able to switch between Linux and Windows with just a couple of key presses.

      Another handy thing is running Windows full screen in a Virtual desktop and being able to switch between Linux and Windows with just a couple of key presses.

      That sounds perfect; and I'm reasonably familiar with virtualbox.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
      In the absence of evidence, opinion is indistinguishable from prejudice.
      me too i'm trying something with virtualbox: are you aware of the possibility to automate things like fullscreen resolution?

      I mean from the virtualbox side.

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
        VirtualBox startvm command accepts a --fullscreen flag. But that's something I don't use myself.
Re: [OT] Windows VMs under Linux for running Perl.
by FreeBeerReekingMonk (Deacon) on Dec 17, 2016 at 22:32 UTC
    Strawberry Perl. CPAN/cpanm works.

    What will you do? fullscreen in your VM?

    * Editors

    Notepad++ (free) or sublime (commercial, but worth it) If you need VI, use winvi it can even hexedit.

    All three can detect DOS/UNIX linebreaks and handle them.

    * Figure out Versions

    I use Meld or Windiff to see diffs. Use tortoisesvn for version control.

    * Virtualbox

    Using Virtualbox? You can share your development directory, and run code both in Unix as Windows (for cross testing). This way you can also use editors on the Linux side.

    If using Virtualbox, consider adding an extra virtual network adapter in BRIDGED modus, so you can always access the box.

    If you like, develop on Linux, then when you need to run it in windows, touch a file which will be checked by a PowerShell script, and run your Perl, or restart a service... and thus receive the output back in Linux...

    * The typical Windows Caveats

    Do not use backticks, use libraries to do things. Lots of libraries will not works nicely (depending on what you need to do).

    * Windows version

    As for the windows version: Develop where you want it to run. All basic perly stuff will work from Windows XP and up (if you do not need much integration, like working around the windows security model because you run as Administrator... XP is pretty light), however, some stuff like WMI has changed over the years, and you will need maybe even a Windows Server edition to work on. (sometimes, even patches matter)

      Thanks, but you've missed my purpose somewhat. I'm comfortable with my Windows setup. What I'm looking for is how to put that setup in a Linux hosted VM such that when I'm using it interactively, I can for the most part ignore that it isn't natively hosted.

      I'm looking for what combination(s) of Linux and VM software is most likely to be transparent to me when I'm using the Window's VM.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re: [OT] Windows VMs under Linux for running Perl.
by stevieb (Canon) on Dec 17, 2016 at 23:41 UTC

    On Windows, berrybrew and for Linux perlbrew for the Perl infrastructure, and for a *very* capable IDE, intelliJ with the spectacularly awesome Camelcade Perl Plugin.

    The plugins can be installed within the IDE itself easily. I'd recommend the Vim plugin as well, but I realize that not all people use the same editor.

    Note that the IDE configuration I recommended works seamlessly on both Linux/Unix and Windows, and it's trivial to save your configuration on one platform, and import it on the other.

    Once you have a decent setup, the platform is almost irrelevant (less some specific distributions, but I digress), so all of this will work on nearly all versions of Windows as well as most versions Linux/Unix.

      Sorry, but I think you missed the purpose of my question. I'm quite happy with my development environment on windows. What I'm looking for is first hand knowledge and guidance of how to set up a Windows VM under Linux such that I can use the Windows environment on that system essentially as if it was the native host of that system.

      I've used a couple of flavors of Linux, running in a couple of different types of VM hosted on Windows; and whilst they're pretty good, I've always found them a little clunky.

      As I am now looking to set things up the other way, I'm hoping someone might be able to narrow the search space for which VM running on which version of Linux is most l;ikely to give a usable Windows environment with a few quirks and annoyances as possible.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re: [OT] Windows VMs under Linux for running Perl.
by james28909 (Deacon) on Dec 19, 2016 at 14:15 UTC
    I know that your looking to setup a windows environment in vm in linux, BUT I would like to mention something that hasnt been mentioned yet. There is bash on ubuntu on windows (WSL) and it has done everything I have wanted except run wine, but the base system is windows so no need for wine.
      There is bash on ubuntu on windows (WSL) ...

      Thanks for that. However, it is almost the exact opposite of what I need. If there was such a thing as cmd on windows on ubuntu, that'd be perfect.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Wine provides that functionality.

        For simple C programs, sometimes I use the MinGW-w64 compiler available in Ubuntu as a cross-compiler, and then test the generated binaries on top of Wine.

        Though, the last time I tried to install Strawberry Perl under Wine it failed.

        Just for curiosity: why do you need or want something like cmd.exe under a Linux distro?

        L*

        There are no rules, there are no thumbs..
        Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1177993]
Approved by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-19 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found