Changes between Version 2 and Version 3 of doc/TorBOX/Dev/MountVDI


Ignore:
Timestamp:
Oct 14, 2012, 10:37:05 PM (7 years ago)
Author:
proper
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/TorBOX/Dev/MountVDI

    v2 v3  
    1 = TorBOX-Gateway =
    2 Power off.
    3 {{{
    4 #!/bin/bash
    5 VBoxManage controlvm "TorBOX-Gateway" poweroff
    6 }}}
     1TorBOX has been renamed to Whonix.
    72
    8 Mount.
    9 {{{
    10 #!/bin/bash
     3This page has been moved. The History of this page might still be interesting.
    114
    12 # TODO
    13 # - Do not run as root. Otherwise we can not get $HOME.
    14 
    15 # Verbose output.
    16 set -x
    17 
    18 # Ensure powered is off. Otherwise disk corruption is at high risk.
    19 VBoxManage controlvm "TorBOX-Gateway" poweroff
    20 
    21 # Make sure required module to mount vdi images is installed.
    22 sudo modprobe nbd
    23 
    24 # Create loopback dev for the image.
    25 sudo qemu-nbd -c /dev/nbd0 "$HOME/VirtualBox VMs/TorBOX-Gateway/TorBOX-Gateway.vdi"
    26 
    27 # Folder has to exist to mount the image.
    28 sudo mkdir -p /tmp/tgimage/
    29 
    30 # Mount the partitions, that are exposed as /dev/nbd0pXXX.
    31 sudo mount  -o noatime,noexec /dev/nbd0p1 /tmp/tgimage/
    32 }}}
    33 
    34 Copy something into it. Example:
    35 {{{
    36 #!/bin/bash
    37 # Copy TorBOX-Gateway script into the image.
    38 #sudo cp "$HOME/TorBOX-Gateway" "/tmp/tgimage/usr/local/bin/TorBOX-Gateway"
    39 }}}
    40 
    41 Unmount.
    42 {{{
    43 #!/bin/bash
    44 
    45 # Verbose output.
    46 set -x
    47 
    48 # In the end unmount.
    49 sudo umount /tmp/tgimage/
    50 
    51 # Shutdown the ndb.
    52 sudo qemu-nbd -d /dev/nbd0
    53 
    54 # Delete temporary folder.
    55 sudo rm -r /tmp/tgimage/
    56 }}}
    57 
    58 Restart Virtual Machine.
    59 {{{
    60 #!/bin/bash
    61 VBoxManage startvm "TorBOX-Gateway"
    62 }}}
    63 
    64 = TorBOX-Workstation =
    65 Power off.
    66 {{{
    67 #!/bin/bash
    68 VBoxManage controlvm "TorBOX-Workstation" poweroff
    69 }}}
    70 
    71 Mount.
    72 {{{
    73 #!/bin/bash
    74 
    75 # Verbose output.
    76 set -x
    77 
    78 # Ensure powered is off. Otherwise disk corruption is at high risk.
    79 VBoxManage controlvm "TorBOX-Workstation" poweroff
    80 
    81 # Make sure required module to mount vdi images is installed.
    82 sudo modprobe nbd
    83 
    84 # Create loopback dev for the image.
    85 sudo qemu-nbd -c /dev/nbd0 "$HOME/VirtualBox VMs/TorBOX-Workstation/TorBOX-Workstation.vdi"
    86 
    87 # Folder has to exist to mount the image.
    88 sudo mkdir -p /tmp/twimage/
    89 
    90 # Mount the partitions, that are exposed as /dev/nbd0pXXX.
    91 sudo mount  -o noatime,noexec /dev/nbd0p1 /tmp/twimage/
    92 }}}
    93 
    94 Copy something into it. Example:
    95 {{{
    96 #!/bin/bash
    97 # Copy TorBOX-Workstation script into the image.
    98 #sudo cp "$HOME/TorBOX-Workstation" "/tmp/twimage/usr/local/bin/TorBOX-Workstation"
    99 }}}
    100 
    101 Unmount.
    102 {{{
    103 #!/bin/bash
    104 
    105 # Verbose output.
    106 set -x
    107 
    108 # Set owner of TorBOX-Workstation script to root, just to be sure.
    109 sudo chown root "/tmp/twimage/usr/local/bin/TorBOX-Workstation"
    110 
    111 # Make TorBOX-Workstation script executable.
    112 sudo chmod +x "/tmp/twimage/usr/local/bin/TorBOX-Workstation"
    113 
    114 # In the end unmount.
    115 sudo umount /tmp/twimage/
    116 
    117 # Shutdown the ndb.
    118 sudo qemu-nbd -d /dev/nbd0
    119 
    120 # Delete temporary folder.
    121 sudo rm -r /tmp/twimage/
    122 }}}
    123 
    124 Restart Virtual Machine.
    125 {{{
    126 #!/bin/bash
    127 VBoxManage startvm "TorBOX-Workstation"
    128 }}}
     5https://sourceforge.net/p/whonix/wiki/BuildDocumentation/