1. Hey guyz. Welcome to the All New Phlatforum!



    Sign Up and take a look around. There are so many awesome new features.

    The Phlatforum is a place we can all hang out and

    have fun sharing our RC adventures!

  2. Dismiss Notice

EMC2 in a Virtual Machine on Windows

Discussion in 'EMC' started by gasmasher, Dec 8, 2009.

  1. gasmasher

    gasmasher New Member

    Offline
    Messages:
    402
    Trophy Points:
    0
    Location:
    Atlanta, GA
    I have seen some interest in running EMC2 in a virtual machine and thought I would come up with a quick tutorial. This method will not allow you to use EMC2 to cut with the PhlatPrinter in Windows but will allow you to become familiar with the interface and use it as a simulator.

    These are just my notes from running a quick test. I will try to edit this later with screen shots and proper speeling and proper grammers.

    Download Ubuntu EMC2 Live CD
    • Download from linuxcnc.org
      http://downloads.vmware.com/d/info/desktop_downloads/vmware_player/3_0
      Click VMWare Player 3.0 towards the bottom of the page
      Click "Download VMware Player for 32-bit and 64-bit Windows"
      Register for an account
      Follow the link in e-mail for Download VMware Player for 32-bit and 64-bit Windows
      Install VMWare Player
      • Installation is straightforward
        Select an install directory and do the Next, Next, Next thing
      Create your VMWare machine

      Start VMWare player and agree (or not) to the license
      Select Create a New Virtual Machine and the wizard will start
      Select "I will install the operating system later" click next
      Select Linux and Version = Ubuntu click next
      Choose a name and location and click next
      Since this will run from the disk image choose the smallest hard drive size possible (0.1) click next
      Click "Customize Hardware" to bring up the Hardware dialog
      Click New CD/DVD (IDE) in the white box
      Check "Connect at power on" and "Use ISO image file"
      Browse for the Ubuntu iso file downloaded in the first step
      Click OK
      Click Finish to close the wizard
      Start the virtual machine using the Play virtual machine link
      Click Remind me Later when it prompts to install VMWare Tools for Linux
      Either wait for the Ubuntu timer to expire or hit Enter on Start or install Ubuntu

    Sharing a gcode folder between Windows and Ubuntu

    In Windows locate the folder where you store your gcode output files
    Right click the folder and select Properties
    Use the Sharing tab to share the folder on the network. Make a note of the Share name you selected
    In Ubuntu select Places | Connect to server ...
    Set Service type to Windows Share.
    Server to Windows IP address (open a command prompt DOS window and run "ipconfig" then look for IP Address)
    Set Share to / (just enter a single forward slash in the blank)
    Set Folder to the Share name you noted earlier
    Set User Name to the name you use when logging into Windows
    Leave Domain Name blank unless you have a domain controller on you network. If you do you probably aren't reading this
    Set Name to use for connection to anything you want, it's like a bookmark name
    Click Connect
    Double click the new folder on the Ubuntu desktop with your Share name
    If you are prompted to log in use your windows logon name and password
    Drag and drop or copy/pasta gcode files onto the Desktop[/list]

    Starting up EMC2 in Simulation mode[/b]
    Under Applications Select CNC | EMC2
    Scroll down and look under stepper and select sim_inch. click OK
    Select No to Copy Configuration. It doesn't really matter what you choose
    Clear the error messages about realtime delays and RTAPI. These errors are saying that the realtime kernel has timing issues since it is running in a virtual machine
    Open a file
    • Use File | Open to get the open file dialog
      click the Directory dropdown and select / at the top
      Double click home
      Double click Ubuntu
      Double click Desktop
      Change Files of type to All files (*)
      Select the file you copied to the Desktop and Open it
      Run a simulation

    • Clear the Emergency Stop (red circle with a white X)
      Turn on the power (red square with an I/O symbol)
      Home each axis by selecting it and clicking Home Axis
      Click the Run button or push r to run the file
    Attached files [​IMG] [​IMG] [​IMG]
     
  2. FozzyTheBear

    FozzyTheBear Member

    Offline
    Messages:
    261
    Trophy Points:
    16
    Excellent Tutorial Tim!! Thanks!! :D personally I tend to boot direct to Linux off a bootable CD and just use use a shared folder, rather than running the virtual machine emulator. Seems to work fine. In fact both ways work fine.

    I set up linux on the spare machine that I have, that only runs Linux and create all the configurations and setup my workspace the way I want it and then create a CD bootable version and copy the configs over in that. It just means you have a bullet proof system that can't get corrupted and you can still use a shared folder with windows to get G-gode in there. I like it. Just another way to do things I suppose.

    I tried a few different distros, RedHat Slackware, Ubuntu etc etc they all have useful and different stuff in them if any of the guys want to experiment with it.

    Best Regards,
    Julian (Fozzy The Bear)
     
  3. gasmasher

    gasmasher New Member

    Offline
    Messages:
    402
    Trophy Points:
    0
    Location:
    Atlanta, GA
    I agree Julian, it is nice being able to boot off a CD directly into the OS. I use a fairly low powered system as my CNC controller and do something very similar to the CD boot. I put an IDE to compact flash adapter on hda and when the system boots it loads a ramdisk image of Slackware off the compact flash. Then I remote X to it from my main system and my home directory with all the gcode is mounted over NFS.

    This tutorial just allows people to take a look at the differences between Mach and EMC2 and decide if it is worth giving it a real try. It also works great as a simulator since VMWare has added DirectX acceleration to the desktop products over the last few years.

    There are a lot of ways to go about it and I hoped this would get some more people interested.
     
  4. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    Fozzy, in doing it this way, are you able to run the machine or just view the simulation?
    Great post Tim thank you for putting this together.
    Mark
     
  5. gasmasher

    gasmasher New Member

    Offline
    Messages:
    402
    Trophy Points:
    0
    Location:
    Atlanta, GA
    Yes Mark, you can use EMC2 as a machine controller when booting from a live CD. If you don't setup a way to store your configuration (like Fozzy does by generating a new live CD) you will have to reconfigure every time you boot from the CD.
     
  6. tvcasualty

    tvcasualty New Member

    Offline
    Messages:
    637
    Trophy Points:
    0
    Great job on this Tim!
     
  7. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    Thank you Tim that's what I was wondering about.
    Mark
     
  8. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Tim, a question about your "loads a ramdisk image of Slackware off the compact flash" system. How long does the bootup take? I was trying to do this with my Dell SX260 pc, but straight from usb. Actually, I was trying to run winxp direct from the compact flash drive and save on buying a harddisk. Never got that to work. Althought, almost. But I did get it to work, loading a ramdisk image from usb. But it took a really long time. More time than I was willing to wait, to continue the investigation.

    -Kwok
     
  9. gasmasher

    gasmasher New Member

    Offline
    Messages:
    402
    Trophy Points:
    0
    Location:
    Atlanta, GA
    I think my current image is just over 100 megs compressed and it takes less 2 or 3 minutes to get to the login prompt. This is a very stripped down install with the RTAPI patches applied to the kernel.

    There is another way to save on a hard disk that is much faster and that is PXE boot. If your network card supports PXE it will broadcast for a TFTP server on the network when enabled (check the bios for network boot in the boot order menu). Then it will download the kernel and initial ramdisk from the server. That is how my media center PCs are setup since I was trying to cut down heat and noise in the living room. Those computers don't have any moving parts (hdd, fans, etc..) or local storage.

    I started a blog almost exactly a year ago and wrote a grand total of four articles. One of them is how to setup a tftp server on Slackware to boot a second Slackware computer. There is at least one free Windows tftp server out there and I'm sure it could also be done just using Cygwin.

    Let me know if you have more questions. This is something I actually know a thing or two about.
     

Share This Page