running virtual machines? - Page 3
Page 3 of 3 FirstFirst 123
Results 31 to 42 of 42

Thread: running virtual machines?

  1. #31
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    2,261
    These are all the steps I took to get the VM completely working.
    VM
    1) Create VM - click new, set name, type and version; set memory (4096 MB); create dynamically allocated virtual disk

    2) Set setting of vm - click vm and choose settings;
    - go to network; adapter 1: NAT, connected; adapter 2: host-only, connected
    - go to Shared folders; add new, choose path to repositories, set name to repositories, check auto-mount

    3) start VM, "insert" centos minimal disk and install OS
    - create root password
    - create user
    - click reboot at end

    4) login, update and install packages
    - yum update
    - yum install gcc make kernel-devel bzip2

    5) install guest additions (I don't remember why I always do this, but I think it's something to do with the shared folders)
    - mkdir -p /media/cdrom
    - mount /dev/scd0 /media/cdrom
    - sh /media/cdrom/VBoxLinuxAdditions.run
    - unmount /media/cdrom
    - rmdir /media/cdrom

    6) Add user to vboxsf group
    - sudo usermod -a -G vboxsf derokorian

    7) add hosts entry(entries)
    - (on vm, to get IP) hostname -I
    - (on host, add to hosts) IP local.<project name>.com

    8) add key file to VM, commands from host
    - ssh-copy-id derokorian@local.<project-name>.com
    - ssh-copy-id root@local.<project-name>.com



    Apache + PHP + MySQL
    Actually, I'm in the process of changing all this to be an ansible folder in each project, so I don't even have to remember s*** but its not done yet, so this is what I did.

    1) Get to root bash
    - sudo bash

    2) Run script to install services; this script install all the yum packages I need, and builds apache, php, mysql the way I like, and if I pass the xdebug_ver (as I did here) it gets xdebug going as well.
    - sh /media/sf_repositories/<name of project>/server/install_services.sh --apache_ver=2.4.25 --php_ver=7.1.2 --xdebug_ver=2.5.1

    3) copy project site config
    - cp /media/sf_repositories/<name of project>/server/vhost.conf /usr/local/apache2/conf/vhosts/<name of project>.conf

    4) symlink project public folder
    - ln -s /media/sf_repositories/<name of project>/public /usr/local/apache2/htdocs/<name of project>

    5) copy php.ini
    - cp /media/sf_repositories/<name of project>/server/php.ini /usr/local/php.ini


    Finally, I reboot the whole machine, and now everything works. I can set up my IDE's interpreter so that I can start debugging as needed, and I can access the site through my host's browser using local.project.com (such as local.derokorian.com)

    Total time: 1hr 27min
    Active Time: < 30min
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  2. #32
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    14,879
    https://www.youtube.com/watch?v=YFl2mCHdv24



    Granted, it's a simple example, and probably some skipping of the time it took to download Docker images, but...

    Here's a real Dockerfile from the Rails app I work on:
    Code:
    FROM *****/centos-ruby:7-ruby2.3.1
    MAINTAINER ******@****.com
    
    # update yum and install postgres library
    RUN yum update -y && \
        yum install -y postgresql-devel && \
        yum install -y make automake gcc gcc-c++ kernel-devel nc && \
        yum install -y graphviz
    
    # create the deploy user
    RUN adduser -u 1000 -ms /bin/bash deploy
    
    # install bundler for deploy user
    RUN gem install bundler --no-ri --no-rdoc
    
    RUN mkdir -p /app/vendor/cache
    ADD .bundle/config /app/.bundle/config
    ADD Gemfile /app/
    ADD Gemfile.lock /app/
    ADD vendor/cache /app/vendor/cache
    RUN chown -R deploy:deploy /app
    RUN chown -R deploy:deploy $RUBY_DIR
    
    USER deploy
    WORKDIR /app
    RUN bundle install --jobs 3 --retry 3 --system
    
    USER root
    COPY . /app
    RUN chown -R deploy:deploy /app
    
    USER deploy
    
    ENTRYPOINT ["/app/docker-entrypoint.sh"]
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #33
    Senior Member
    Join Date
    Apr 2003
    Location
    Flanders Fields
    Posts
    5,833
    Thank you both for taking the trouble to post this stuff. I hope to examine it in more detail when I get a moment. I also hope to check out Laravel Homestead, which is tailor-made for Laravel dev.
    IMPORTANT: STOP using the mysql extension. Use mysqli or pdo instead.
    World War One happened 100 years ago. Visit Old Grey Horror for the agony and irony.

  4. #34
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    2,261
    I finished "Ansible-lizing" my server build. Last night I deployed 3 new servers using ansible and they all worked great. From now I need <3 min of interaction to get a VM going or a new droplet (on digitalocean). Still uses built php/apache instead of a package as I find it much easier to control my interpreter that way than to rely on some yum repository.
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  5. #35
    Senior Member
    Join Date
    Apr 2003
    Location
    Flanders Fields
    Posts
    5,833
    Quote Originally Posted by NogDog View Post
    "3. it just works"

    I've heard that before.
    IMPORTANT: STOP using the mysql extension. Use mysqli or pdo instead.
    World War One happened 100 years ago. Visit Old Grey Horror for the agony and irony.

  6. #36
    Senior Member
    Join Date
    Apr 2003
    Location
    Flanders Fields
    Posts
    5,833
    Saw this article yesterday btw:
    https://arstechnica.com/security/201...00-at-pwn2own/

    If you were thinking you could use a virtual machine to keep from getting hacked while you're sniffing around the darknet, you are mistaken.
    IMPORTANT: STOP using the mysql extension. Use mysqli or pdo instead.
    World War One happened 100 years ago. Visit Old Grey Horror for the agony and irony.

  7. #37
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    2,261
    Quote Originally Posted by sneakyimp View Post
    Saw this article yesterday btw:
    https://arstechnica.com/security/201...00-at-pwn2own/

    If you were thinking you could use a virtual machine to keep from getting hacked while you're sniffing around the darknet, you are mistaken.
    Or you know, just don't use MS products.
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  8. #38
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    8,521
    Quote Originally Posted by Derokorian View Post
    Or you know, just don't use MS products.
    Actually, after poking around the WikiLeaks recent claims about the CIA's malware suite, I'm thinking of going home, raising more barbed-wire, and using quill and ink on papyrus, raising a large garden and feeding and occasionally eating the native rabbit/turkey/deer population. They're targeting every well-known OS in the world, including all the 'Nixen.
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  9. #39
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    2,261
    Quote Originally Posted by dalecosp View Post
    Actually, after poking around the WikiLeaks recent claims about the CIA's malware suite, I'm thinking of going home, raising more barbed-wire, and using quill and ink on papyrus, raising a large garden and feeding and occasionally eating the native rabbit/turkey/deer population. They're targeting every well-known OS in the world, including all the 'Nixen.
    I meant more just their browsers. Incoherent pieces of crap. Honestly, I don't care who is spying on me - they aren't going to learn anything of interest! I couldn't be a more boring person to spy on :P
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  10. #40
    Settled 4 red convertible dalecosp's Avatar
    Join Date
    Jul 2002
    Location
    Accelerating Windows at 9.81 m/s....
    Posts
    8,521
    Quote Originally Posted by Derokorian View Post
    I meant more just their browsers. Incoherent pieces of crap. Honestly, I don't care who is spying on me - they aren't going to learn anything of interest! I couldn't be a more boring person to spy on :P
    http://i.ytimg.com/vi/PW_02k7LRMo/maxresdefault.jpg
    /!!\ mysql_ is deprecated --- don't use it! Tell your hosting company you will switch if they don't upgrade! /!!!\ ereg() is deprecated --- don't use it!

    dalecosp "God doesn't play dice." --- Einstein "Perl is hardly a paragon of beautiful syntax." --- Weedpacket

    Getting Help at All --- Collected Solutions to Common Problems --- Debugging 101 --- Unanswered Posts --- OMBE: Office Machines, Business Equipment

  11. #41
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    2,261
    You will NOT touch my dog. I promise you that!

    my boys.jpg
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  12. #42
    Junior Member
    Join Date
    Apr 2017
    Location
    Dubai, United Arab Emirates
    Posts
    1
    Quote Originally Posted by Derokorian View Post
    Or you know, just don't use MS products.
    You're right, MS products aren't safe

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •