New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Installation failed !" "Exit code: 256" in GUI #30

Open
Lin-Buo-Ren opened this Issue Feb 13, 2016 · 53 comments

Comments

Projects
None yet
@Lin-Buo-Ren
Collaborator

Lin-Buo-Ren commented Feb 13, 2016

Install log(when running winusbgui as normal user)

Installation failed !
Exit code: 256
Log:
**blank**

_001

Install log(when running winusbgui as root)

Installation failed !
Exit code: 256
Log:
Formatting device...
Wait 3 seconds for block device nodes to populate...
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mkfs.fat 3.0.28 (2015-05-16)
Mounting...
mount: /dev/loop0 is write-protected, mounting read-only
Copying...
Installing grub...
Installing for i386-pc platform.
Installation finished. No error reported.
Installing grub.cfg...
Exiting...
Syncing...
/usr/local/bin/winusb: 行 78: 20260 終止                  while true; do
    sleep 0.05; echo 'pulse';
done
Cleaning...
/usr/local/bin/winusb: 行 78: 20593 終止                  while true; do
    sleep 0.05; echo 'pulse';
done
Unmounting and removing '/media/winusb_iso_1455346491_15903'...
Unmounting and removing '/media/winusb_target_1455346491_15903'...

P.S. "終止" in the output approximately means "terminated".

Reporter's Environment

Operating System

Ubuntu 15.10 AMD64

WinUSB

commit f3bd9ec

Software Installation Prefix

/usr/local

WxWidgets

3.0.2+dfsg-1.2 from Ubuntu 15.10 software source

Locale

LANG=zh_TW.UTF-8
LANGUAGE=zh_TW:zh_HK:zh_CN:en_US:en
LC_CTYPE="zh_TW.UTF-8"
LC_NUMERIC=zh_TW.UTF-8
LC_TIME=zh_TW.UTF-8
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY=zh_TW.UTF-8
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER=zh_TW.UTF-8
LC_NAME=zh_TW.UTF-8
LC_ADDRESS=zh_TW.UTF-8
LC_TELEPHONE=zh_TW.UTF-8
LC_MEASUREMENT=zh_TW.UTF-8
LC_IDENTIFICATION=zh_TW.UTF-8
LC_ALL=
@slacka

This comment has been minimized.

Show comment
Hide comment
@slacka

slacka May 17, 2016

Owner

@Lin-Buo-Ren
Do you have gksudo command installed on your system?

Owner

slacka commented May 17, 2016

@Lin-Buo-Ren
Do you have gksudo command installed on your system?

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren May 17, 2016

Collaborator

@slacka

Do you have gksudo command installed on your system?

I'm pretty sure I have it installed

Collaborator

Lin-Buo-Ren commented May 17, 2016

@slacka

Do you have gksudo command installed on your system?

I'm pretty sure I have it installed

@Justinzobel

This comment has been minimized.

Show comment
Hide comment
@Justinzobel

Justinzobel Jun 25, 2016

Exit code: 32512
Log:

Also error while installing. I don't have gksudo but I do have pkexec so perhaps it could look for which is installed when compiling and use that?

Exit code: 32512
Log:

Also error while installing. I don't have gksudo but I do have pkexec so perhaps it could look for which is installed when compiling and use that?

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Jul 8, 2016

Collaborator

@Justinzobel That can be done in runtime.

BTW the 'winusb' package does depend on 'gksu' package, which provides 'gksu' and 'gksudo' commands

Collaborator

Lin-Buo-Ren commented Jul 8, 2016

@Justinzobel That can be done in runtime.

BTW the 'winusb' package does depend on 'gksu' package, which provides 'gksu' and 'gksudo' commands

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
Collaborator

Lin-Buo-Ren commented Jul 8, 2016

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Jul 9, 2016

Collaborator

I can't reproduce the issue in the latest build, may re-open it when I notice it agian

Collaborator

Lin-Buo-Ren commented Jul 9, 2016

I can't reproduce the issue in the latest build, may re-open it when I notice it agian

@Lin-Buo-Ren Lin-Buo-Ren closed this Jul 9, 2016

@muzena

This comment has been minimized.

Show comment
Hide comment
@muzena

muzena Jul 20, 2016

@Lin-Buo-Ren
I have same problem in In Mint 18 and Ubunt Xenial

muzena commented Jul 20, 2016

@Lin-Buo-Ren
I have same problem in In Mint 18 and Ubunt Xenial

@slug45

This comment has been minimized.

Show comment
Hide comment
@slug45

slug45 Sep 12, 2016

I think you need the destination partition/drive to be unmounted to make it work.

slug45 commented Sep 12, 2016

I think you need the destination partition/drive to be unmounted to make it work.

@johnnirmal007

This comment has been minimized.

Show comment
Hide comment
@johnnirmal007

johnnirmal007 Oct 2, 2016

I got same problem but solved now by
"sudo apt-get install gksu"
"gksudo winusbgui"
(i.e..type it without quotes)

I got same problem but solved now by
"sudo apt-get install gksu"
"gksudo winusbgui"
(i.e..type it without quotes)

@Lin-Buo-Ren Lin-Buo-Ren changed the title from "Installation failed !" in GUI but not in CLI to "Installation failed !" in GUI but not in CLI (/usr/bin/winusb: line 78: 18265 Terminated ) Nov 8, 2016

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Nov 8, 2016

Collaborator

Reopen issue as there's new incoming report.

_060

Collaborator

Lin-Buo-Ren commented Nov 8, 2016

Reopen issue as there's new incoming report.

_060

@Lin-Buo-Ren Lin-Buo-Ren reopened this Nov 8, 2016

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Nov 8, 2016

Collaborator

Hi again, please use the latest revision in GitHub repo and see if it's still reproducible(it should be, as we never fixed the problem anyway).

Collaborator

Lin-Buo-Ren commented Nov 8, 2016

Hi again, please use the latest revision in GitHub repo and see if it's still reproducible(it should be, as we never fixed the problem anyway).

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Nov 8, 2016

Collaborator

The problem seems to be on the pulse function, however I have no idea why it's failing...

pulseCurrentPid=0
function pulse()
{
    if [ "$forGui" -eq 1 ]; then
        if [ ! "$pulseCurrentPid" -eq 0 ]; then
            kill "$pulseCurrentPid"
            #wait "$pulseCurrentPid"
            pulseCurrentPid=0
        fi

        if [ "$1" = 'on' ]; then
            cd /; while true; do sleep 0.05; echo 'pulse'; done &
            pulseCurrentPid="$!"
        elif [ "$1" != 'off' ]; then
            echo "Pulse: bad argument" >&2
            exit 1
        fi
    fi
}
Collaborator

Lin-Buo-Ren commented Nov 8, 2016

The problem seems to be on the pulse function, however I have no idea why it's failing...

pulseCurrentPid=0
function pulse()
{
    if [ "$forGui" -eq 1 ]; then
        if [ ! "$pulseCurrentPid" -eq 0 ]; then
            kill "$pulseCurrentPid"
            #wait "$pulseCurrentPid"
            pulseCurrentPid=0
        fi

        if [ "$1" = 'on' ]; then
            cd /; while true; do sleep 0.05; echo 'pulse'; done &
            pulseCurrentPid="$!"
        elif [ "$1" != 'off' ]; then
            echo "Pulse: bad argument" >&2
            exit 1
        fi
    fi
}
@OrDuan

This comment has been minimized.

Show comment
Hide comment
@OrDuan

OrDuan Nov 17, 2016

I was encountered this issue right now, with windows 10.
I'm on ubuntu 16.04 and WinUSB 1.0.11

I tried to run the installation anyway and it worked(I just ignored the error).

OrDuan commented Nov 17, 2016

I was encountered this issue right now, with windows 10.
I'm on ubuntu 16.04 and WinUSB 1.0.11

I tried to run the installation anyway and it worked(I just ignored the error).

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Nov 17, 2016

Collaborator

@OrDuan Hi, please use the latest revision in the repository (instead of latest released version) for reproducing the issue.

We've have changed a quite amount of code since 1.0.11

Collaborator

Lin-Buo-Ren commented Nov 17, 2016

@OrDuan Hi, please use the latest revision in the repository (instead of latest released version) for reproducing the issue.

We've have changed a quite amount of code since 1.0.11

@temyrrian

This comment has been minimized.

Show comment
Hide comment
@temyrrian

temyrrian Nov 21, 2016

I got similar problem and solve it!
I dont now why, but if you use GUI its not work. Use command line in way:
sudo winusb --format /path-to-ISO-file/filename.iso /dev/sdb (or other way to your flash)

I got similar problem and solve it!
I dont now why, but if you use GUI its not work. Use command line in way:
sudo winusb --format /path-to-ISO-file/filename.iso /dev/sdb (or other way to your flash)

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Nov 22, 2016

Collaborator

@temyrrian The issue title already tell that CLI(command line interface) works.
This issue is about the GUI problem

Collaborator

Lin-Buo-Ren commented Nov 22, 2016

@temyrrian The issue title already tell that CLI(command line interface) works.
This issue is about the GUI problem

@lin90577

This comment has been minimized.

Show comment
Hide comment
@lin90577

lin90577 Jan 19, 2017

The GUI fix is to blank the USB, DO NOT FORMAT drive this is for the Error 256 issue.

The GUI fix is to blank the USB, DO NOT FORMAT drive this is for the Error 256 issue.

@a-n-d-r-e-i

This comment has been minimized.

Show comment
Hide comment
@a-n-d-r-e-i

a-n-d-r-e-i Jan 26, 2017

I was able to reproduce this error using the GUI version and in my case simply ignore the error haven't solved the problem.

Log as root

Installation failed !
Exit code: 256
Log:
Formatting device...
Wait 3 seconds for block device nodes to populate...
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mkfs.fat 3.0.28 (2015-05-16)
Mounting...
Copying...
Installing grub...
Installing for i386-pc platform.
Installation finished. No error reported.
Installing grub.cfg...
Exiting...
Syncing...
/usr/bin/winusb: line 78: 32619 Terminated              while true; do
    sleep 0.05; echo 'pulse';
done
Cleaning...
/usr/bin/winusb: line 78:  3517 Terminated              while true; do
    sleep 0.05; echo 'pulse';
done
Unmounting and removing '/media/winusb_iso_1485449591_28119'...
Unmounting and removing '/media/winusb_target_1485449591_28119'...

Environment

I do have gksu package installed.

Operating System

Ubuntu 16.04 AMD64

Locale

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE=pt_BR.UTF-8
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=

WinUSB

commit 28ff500

CLI

I'm also getting an error when I try using the CLI:

sudo winusb -v --format ~/Downloads/win10.iso /dev/sdb1
Formatting device...
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 
on /dev/sdb1 have been written, but we have been unable to 
inform the kernel of the change, probably because it/they are in use.  
As a result, the old partition(s) will remain in use.  
You should reboot now before making further changes.

a-n-d-r-e-i commented Jan 26, 2017

I was able to reproduce this error using the GUI version and in my case simply ignore the error haven't solved the problem.

Log as root

Installation failed !
Exit code: 256
Log:
Formatting device...
Wait 3 seconds for block device nodes to populate...
mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows
mkfs.fat 3.0.28 (2015-05-16)
Mounting...
Copying...
Installing grub...
Installing for i386-pc platform.
Installation finished. No error reported.
Installing grub.cfg...
Exiting...
Syncing...
/usr/bin/winusb: line 78: 32619 Terminated              while true; do
    sleep 0.05; echo 'pulse';
done
Cleaning...
/usr/bin/winusb: line 78:  3517 Terminated              while true; do
    sleep 0.05; echo 'pulse';
done
Unmounting and removing '/media/winusb_iso_1485449591_28119'...
Unmounting and removing '/media/winusb_target_1485449591_28119'...

Environment

I do have gksu package installed.

Operating System

Ubuntu 16.04 AMD64

Locale

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE=pt_BR.UTF-8
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=

WinUSB

commit 28ff500

CLI

I'm also getting an error when I try using the CLI:

sudo winusb -v --format ~/Downloads/win10.iso /dev/sdb1
Formatting device...
Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 
33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 
on /dev/sdb1 have been written, but we have been unable to 
inform the kernel of the change, probably because it/they are in use.  
As a result, the old partition(s) will remain in use.  
You should reboot now before making further changes.
@fedix23

This comment has been minimized.

Show comment
Hide comment
@fedix23

fedix23 Feb 28, 2017

I think i have a solution
I used gparted to unmount the usb then format it to ntfs and it's work

fedix23 commented Feb 28, 2017

I think i have a solution
I used gparted to unmount the usb then format it to ntfs and it's work

@LuccaPrado

This comment has been minimized.

Show comment
Hide comment
@LuccaPrado

LuccaPrado Apr 18, 2017

@fedix23 This worked for me too, but, now the question is where the error come from?

@fedix23 This worked for me too, but, now the question is where the error come from?

@dvnrsn

This comment has been minimized.

Show comment
Hide comment
@dvnrsn

dvnrsn Apr 28, 2017

Kubuntu 16, similar response to @a-n-d-r-e-i

dvnrsn commented Apr 28, 2017

Kubuntu 16, similar response to @a-n-d-r-e-i

@murilopan

This comment has been minimized.

Show comment
Hide comment
@murilopan

murilopan Apr 28, 2017

I went through all the suggestions above, none worked... the only thing that worked for me was:
*Format the Flash the USB Stick

Now if you excuse me, gonna install the crap Windows onto somebody else's machine, hope my hands don't get infected... LOL

I went through all the suggestions above, none worked... the only thing that worked for me was:
*Format the Flash the USB Stick

Now if you excuse me, gonna install the crap Windows onto somebody else's machine, hope my hands don't get infected... LOL

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Jun 12, 2017

Collaborator

No longer reproduced and the /usr/bin/winusb: line 78: 18265 Terminated message probably comes from the pulse function in src/woeusb, closing...

Collaborator

Lin-Buo-Ren commented Jun 12, 2017

No longer reproduced and the /usr/bin/winusb: line 78: 18265 Terminated message probably comes from the pulse function in src/woeusb, closing...

Lin-Buo-Ren added a commit that referenced this issue Jun 12, 2017

src/winusb: Silent the confusing "/usr/bin/woeusb: line XXX: XXXXX Te…
…rminated" message

Related-GitHub-issue: #30
Signed-off-by: 林博仁 <Buo.Ren.Lin@gmail.com>
@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Jun 14, 2017

Collaborator

According to WebUpd8 the issue still can be reproduced, reopened.

Collaborator

Lin-Buo-Ren commented Jun 14, 2017

According to WebUpd8 the issue still can be reproduced, reopened.

@Lin-Buo-Ren Lin-Buo-Ren reopened this Jun 14, 2017

@Lin-Buo-Ren Lin-Buo-Ren changed the title from "Installation failed !" in GUI but not in CLI (/usr/bin/winusb: line 78: 18265 Terminated ) to "Installation failed !" "Exit code: 256" in GUI Jun 14, 2017

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Jun 14, 2017

Collaborator

Some investigation of the Exit code: 256:

  • At least in Linux all program's exit status is 8-bit(0~255), so the 256 isn't come from the external command but probably come from the API that calls it
  • The external command is called and returned to the following src/MainPanel.cpp code:
PipeManager pipe(std::string("pkexec sh -c 'woeusb --no-color --for-gui --format \"") + iso + "\" \"" + device + "\" 2>&1'");

/* A bunch of code managing the install progress */

int exitCode = pipe.Close();
if(exitCode == 0)
{
	wxMessageBox(_("Installation succeded !"), _("Installation"), wxOK | wxICON_INFORMATION, this);
}
else
{
	wxMessageBox(wxString(_("Installation failed !")) + _T("\nExit code: ") + wxNbToStr(exitCode) + _T("\nLog:\n") + log, _("Installation"), wxOK | wxICON_ERROR, this);
}

The PipeManager is a custom class dealing with the external call and its output stream, at src/processManager.cpp, with the constructor and Close method like this:

PipeManager::PipeManager(const std::string &command)
{
    m_pipe = popen(command.c_str(), "r");

    if(m_pipe == NULL)
    {
        MY_THROW("Can't open pipe for command '" << command << "' !");
    }
}

int PipeManager::Close()
{
    if(m_pipe)
    {
        int exitCode = pclose(m_pipe);
        m_pipe = NULL;
        return exitCode;
    }
    else
    {
        MY_THROW("Pipe not open !");
    }
}

As you can see the exit status comes from the pclose(3) external library function, which has the follow synopsis and return code:

int pclose(FILE *stream);

The pclose() function returns -1 if wait4(2) returns an error, or some
other error is detected.

Which still doesn't mention the "256" exit status, a dead end.

Collaborator

Lin-Buo-Ren commented Jun 14, 2017

Some investigation of the Exit code: 256:

  • At least in Linux all program's exit status is 8-bit(0~255), so the 256 isn't come from the external command but probably come from the API that calls it
  • The external command is called and returned to the following src/MainPanel.cpp code:
PipeManager pipe(std::string("pkexec sh -c 'woeusb --no-color --for-gui --format \"") + iso + "\" \"" + device + "\" 2>&1'");

/* A bunch of code managing the install progress */

int exitCode = pipe.Close();
if(exitCode == 0)
{
	wxMessageBox(_("Installation succeded !"), _("Installation"), wxOK | wxICON_INFORMATION, this);
}
else
{
	wxMessageBox(wxString(_("Installation failed !")) + _T("\nExit code: ") + wxNbToStr(exitCode) + _T("\nLog:\n") + log, _("Installation"), wxOK | wxICON_ERROR, this);
}

The PipeManager is a custom class dealing with the external call and its output stream, at src/processManager.cpp, with the constructor and Close method like this:

PipeManager::PipeManager(const std::string &command)
{
    m_pipe = popen(command.c_str(), "r");

    if(m_pipe == NULL)
    {
        MY_THROW("Can't open pipe for command '" << command << "' !");
    }
}

int PipeManager::Close()
{
    if(m_pipe)
    {
        int exitCode = pclose(m_pipe);
        m_pipe = NULL;
        return exitCode;
    }
    else
    {
        MY_THROW("Pipe not open !");
    }
}

As you can see the exit status comes from the pclose(3) external library function, which has the follow synopsis and return code:

int pclose(FILE *stream);

The pclose() function returns -1 if wait4(2) returns an error, or some
other error is detected.

Which still doesn't mention the "256" exit status, a dead end.

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Jun 14, 2017

Collaborator

Maybe a type conversion issue instead?

The exitCode is int and is passed to wxNbToStr to convert to some sort of string. wxNbToStr, which is defined in src/strWxStdConv.hpp called nbToString with the exitCode as argument. nbToString is defined in src/nbStrConvert.hpp with this definition:

template < typename T >
std::string nbToString(const T &nb)
{
    std::stringstream ss;
    std::string str;
    if(sizeof(T) != 1) // Pas char
    {
        ss << std::fixed << nb; // fixed : pas de nb scientifique. Par contre, plein de zero...
    }
    else
    {
        // Type char ==> on le tranforme en int
        ss << std::fixed << int(nb); // fixed : pas de nb scientifique. Par contre, plein de zero...
    }
    ss >> str;

    // On enléve les 0 et . innutils
    std::string::iterator it = str.end() - 1;
    if(str.find('.') != std::string::npos) // On ne racourci pas le nb si pas de virgule
    {
        while(str.size() > 1 && *it == '0')
        {
            str.erase(it);
            it = str.end() - 1;
        }

        if(*it == '.') // Si on arrive à la virgule ==> suppression.
        {
            str.erase(it);
        }
    }

    return str;
}

Which I have no idea what it does for now.

Collaborator

Lin-Buo-Ren commented Jun 14, 2017

Maybe a type conversion issue instead?

The exitCode is int and is passed to wxNbToStr to convert to some sort of string. wxNbToStr, which is defined in src/strWxStdConv.hpp called nbToString with the exitCode as argument. nbToString is defined in src/nbStrConvert.hpp with this definition:

template < typename T >
std::string nbToString(const T &nb)
{
    std::stringstream ss;
    std::string str;
    if(sizeof(T) != 1) // Pas char
    {
        ss << std::fixed << nb; // fixed : pas de nb scientifique. Par contre, plein de zero...
    }
    else
    {
        // Type char ==> on le tranforme en int
        ss << std::fixed << int(nb); // fixed : pas de nb scientifique. Par contre, plein de zero...
    }
    ss >> str;

    // On enléve les 0 et . innutils
    std::string::iterator it = str.end() - 1;
    if(str.find('.') != std::string::npos) // On ne racourci pas le nb si pas de virgule
    {
        while(str.size() > 1 && *it == '0')
        {
            str.erase(it);
            it = str.end() - 1;
        }

        if(*it == '.') // Si on arrive à la virgule ==> suppression.
        {
            str.erase(it);
        }
    }

    return str;
}

Which I have no idea what it does for now.

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Jun 14, 2017

Collaborator

I've managed to reproduce the bug again by issue #109 , this time I'm pretty sure that the exit status is actually 1 instead of 256, and more possibility that this is in fact a numeric conversion issue.

_151

Still unsure where's the problem though...

Collaborator

Lin-Buo-Ren commented Jun 14, 2017

I've managed to reproduce the bug again by issue #109 , this time I'm pretty sure that the exit status is actually 1 instead of 256, and more possibility that this is in fact a numeric conversion issue.

_151

Still unsure where's the problem though...

@Tarkken

This comment has been minimized.

Show comment
Hide comment
@Tarkken

Tarkken Aug 7, 2017

I believe this may be a different issue, but to reply to @Justinzobel; I found that make and make install hadn't placed the two executables woeusb and woeusbgui in my /usr/bin, and that doing so fixed the Exit code: 32512 error. Sorry if this is the wrong place for this. Should also mention I've never compiled anything before, so I'm not exactly prime use-case here.

Tarkken commented Aug 7, 2017

I believe this may be a different issue, but to reply to @Justinzobel; I found that make and make install hadn't placed the two executables woeusb and woeusbgui in my /usr/bin, and that doing so fixed the Exit code: 32512 error. Sorry if this is the wrong place for this. Should also mention I've never compiled anything before, so I'm not exactly prime use-case here.

@Justinzobel

This comment has been minimized.

Show comment
Hide comment
@Justinzobel

Justinzobel Aug 7, 2017

Thanks @Tarkken, the main issue is now that not all distributions have gksudo, but rather pkexec but WoeUSB doesn't have an option to use it.

Thanks @Tarkken, the main issue is now that not all distributions have gksudo, but rather pkexec but WoeUSB doesn't have an option to use it.

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Aug 7, 2017

Collaborator

WoeUSB no longer uses gksudo in current code

Collaborator

Lin-Buo-Ren commented Aug 7, 2017

WoeUSB no longer uses gksudo in current code

@Justinzobel

This comment has been minimized.

Show comment
Hide comment
@Justinzobel

Justinzobel Aug 8, 2017

Excellent, I'll try it out again.

Excellent, I'll try it out again.

@lawchau

This comment has been minimized.

Show comment
Hide comment
@lawchau

lawchau Sep 22, 2017

I have solved this problem myself, I am using Lubuntu 17.04 desktop amd64 version Kernel Linux 4.10.0-35 generic x86_64, the solution is that first I format the pendrive with MBR/DOS using DISKS tool at the menu > preferences, then DO NOT CREATE PARTITION (*IMPORTANT!), after that I just use the WoeUsb gui select the windows 10 image file and it works!

*I get this error 256 whenever I have created the partition for the pendrive until I try not to create the partition.

lawchau commented Sep 22, 2017

I have solved this problem myself, I am using Lubuntu 17.04 desktop amd64 version Kernel Linux 4.10.0-35 generic x86_64, the solution is that first I format the pendrive with MBR/DOS using DISKS tool at the menu > preferences, then DO NOT CREATE PARTITION (*IMPORTANT!), after that I just use the WoeUsb gui select the windows 10 image file and it works!

*I get this error 256 whenever I have created the partition for the pendrive until I try not to create the partition.

@imasaru

This comment has been minimized.

Show comment
Hide comment
@imasaru

imasaru Sep 22, 2017

@lawchau 's solution worked for me as well for writing a Windows 10 Pro x64 .iso to a SanDisk Extreme 64GB flash drive.
Linux Mint 18.1 x64, running Linux Kernel 4.4.0-53.

imasaru commented Sep 22, 2017

@lawchau 's solution worked for me as well for writing a Windows 10 Pro x64 .iso to a SanDisk Extreme 64GB flash drive.
Linux Mint 18.1 x64, running Linux Kernel 4.4.0-53.

@HarshSharma12

This comment has been minimized.

Show comment
Hide comment
@HarshSharma12

HarshSharma12 Oct 11, 2017

I am using CentOS 7 and I am also getting Error 256 but my log looks a bit different from everyone else here.

/usr/local/bin/woeusb: line 360: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 361: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 362: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 257: local: -n: invalid optione 
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 258: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 259: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 260: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 1381: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 1383: array_ref: unbound variable
/usr/local/bin/woeusb: line 1407: declare: -n: invalid option
declare: usage: declare [-aAfFgilrtux] [-p] [name[=value] ...]
/usr/local/bin/woeusb: line 1407: declare: -n: invalid option
declare: usage: declare [-aAfFgilrtux] [-p] [name[=value] ...]

I am getting the same error when I run via the terminal sudo woeusb --device ~/Downloads/Win10_1703_English_x64.iso /dev/sdb

OS Information

CentOS 7
Kernel - 3.10.0-514.6.1.el7.x86_64
Bash version - GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)

HarshSharma12 commented Oct 11, 2017

I am using CentOS 7 and I am also getting Error 256 but my log looks a bit different from everyone else here.

/usr/local/bin/woeusb: line 360: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 361: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 362: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 257: local: -n: invalid optione 
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 258: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 259: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 260: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 1381: local: -n: invalid option
local: usage: local [option] name[=value] ...
/usr/local/bin/woeusb: line 1383: array_ref: unbound variable
/usr/local/bin/woeusb: line 1407: declare: -n: invalid option
declare: usage: declare [-aAfFgilrtux] [-p] [name[=value] ...]
/usr/local/bin/woeusb: line 1407: declare: -n: invalid option
declare: usage: declare [-aAfFgilrtux] [-p] [name[=value] ...]

I am getting the same error when I run via the terminal sudo woeusb --device ~/Downloads/Win10_1703_English_x64.iso /dev/sdb

OS Information

CentOS 7
Kernel - 3.10.0-514.6.1.el7.x86_64
Bash version - GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu)

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Oct 11, 2017

Collaborator

/usr/local/bin/woeusb: line 360: local: -n: invalid option
local: usage: local [option] name[=value] ...

This is due to the GNU Bash version you using doesn't support nameref parameter attributes, which version of GNU Bash you're using?

Anyway this should be filed as a separate issue as the symptom isn't exactly the same.

Collaborator

Lin-Buo-Ren commented Oct 11, 2017

/usr/local/bin/woeusb: line 360: local: -n: invalid option
local: usage: local [option] name[=value] ...

This is due to the GNU Bash version you using doesn't support nameref parameter attributes, which version of GNU Bash you're using?

Anyway this should be filed as a separate issue as the symptom isn't exactly the same.

@HarshSharma12

This comment has been minimized.

Show comment
Hide comment
@HarshSharma12

HarshSharma12 Oct 11, 2017

HarshSharma12 commented Oct 11, 2017

@depadiernos

This comment has been minimized.

Show comment
Hide comment
@depadiernos

depadiernos Oct 26, 2017

So I encountered this issue as well. However, as @slug45 mentioned, unmounting the volume with umount /dev/sdb1 fixed my issue. Perhaps a check to see if it's mounted and unmounting it if it is would be the solution?

depadiernos commented Oct 26, 2017

So I encountered this issue as well. However, as @slug45 mentioned, unmounting the volume with umount /dev/sdb1 fixed my issue. Perhaps a check to see if it's mounted and unmounting it if it is would be the solution?

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Oct 26, 2017

Collaborator

The core script src/woeusb already checks the mount status of all partitions in target device at https://github.com/slacka/WoeUSB/blob/master/src/woeusb#L519 , is this issue still can be reproduced on the latest release of WoeUSB?

Collaborator

Lin-Buo-Ren commented Oct 26, 2017

The core script src/woeusb already checks the mount status of all partitions in target device at https://github.com/slacka/WoeUSB/blob/master/src/woeusb#L519 , is this issue still can be reproduced on the latest release of WoeUSB?

@kode54

This comment has been minimized.

Show comment
Hide comment
@kode54

kode54 Nov 6, 2017

It seems to emit that error here if the target media is formatted FAT when preparing Windows 10 boot media. Maybe some cases should prepare NTFS instead?

E: It's failing trying to install i386 Grub on the boot media, since my installed Grub doesn't support i386, I think. I don't need Grub anyway, since it's Windows install media.

kode54 commented Nov 6, 2017

It seems to emit that error here if the target media is formatted FAT when preparing Windows 10 boot media. Maybe some cases should prepare NTFS instead?

E: It's failing trying to install i386 Grub on the boot media, since my installed Grub doesn't support i386, I think. I don't need Grub anyway, since it's Windows install media.

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Nov 6, 2017

Collaborator

@kode54

It seems to emit that error here if the target media is formatted FAT when preparing
Windows 10 boot media. Maybe some cases should prepare NTFS instead?

Only boot media contains an install image over 4GiB should use NTFS, this doesn't include any of the Microsoft-released official Windows install images.

E: It's failing trying to install i386 Grub on the boot media, since my installed Grub doesn't
support i386, I think. I don't need Grub anyway, since it's Windows install media.

i386-pc variant GRUB data is required if you need to boot it in legacy PC mode because we can only chainload Windows BOOTMGR under this case.

Collaborator

Lin-Buo-Ren commented Nov 6, 2017

@kode54

It seems to emit that error here if the target media is formatted FAT when preparing
Windows 10 boot media. Maybe some cases should prepare NTFS instead?

Only boot media contains an install image over 4GiB should use NTFS, this doesn't include any of the Microsoft-released official Windows install images.

E: It's failing trying to install i386 Grub on the boot media, since my installed Grub doesn't
support i386, I think. I don't need Grub anyway, since it's Windows install media.

i386-pc variant GRUB data is required if you need to boot it in legacy PC mode because we can only chainload Windows BOOTMGR under this case.

@Lin-Buo-Ren

This comment has been minimized.

Show comment
Hide comment
@Lin-Buo-Ren

Lin-Buo-Ren Nov 6, 2017

Collaborator

The suspicious "terminated" line is found to be the job control message issued by the interpreter itself, and is not related to this issue. This message is eliminated since commit 75e875e.

Collaborator

Lin-Buo-Ren commented Nov 6, 2017

The suspicious "terminated" line is found to be the job control message issued by the interpreter itself, and is not related to this issue. This message is eliminated since commit 75e875e.

@arigit

This comment has been minimized.

Show comment
Hide comment
@arigit

arigit Nov 7, 2017

Run into this error - after trying workarounds like removing the partition in the USB, FAT, NTFS format etc, I ended up using command line (--device) and sudo and it worked. The problem might be related to the GUI under Wayland

arigit commented Nov 7, 2017

Run into this error - after trying workarounds like removing the partition in the USB, FAT, NTFS format etc, I ended up using command line (--device) and sudo and it worked. The problem might be related to the GUI under Wayland

@shubhamkumar13

This comment has been minimized.

Show comment
Hide comment
@shubhamkumar13

shubhamkumar13 Jan 8, 2018

I was able to create a bootable image after formating the usb drive with NTFS file system.
Didn't need to unmount it.

I was able to create a bootable image after formating the usb drive with NTFS file system.
Didn't need to unmount it.

@adonespitogo

This comment has been minimized.

Show comment
Hide comment
@adonespitogo

adonespitogo Jan 16, 2018

I have a usb flash drive formatted ext4. I had to unmount it first for it to work.

I have a usb flash drive formatted ext4. I had to unmount it first for it to work.

@eutektoid

This comment has been minimized.

Show comment
Hide comment
@eutektoid

eutektoid Feb 14, 2018

I wanted to create a bootable Win10-Stick too. At first I used dd (which does not work). Then I came across a tutorial about woeusb.
So I typed into the Terminal:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install woeusb

When I started the program via GUI, I received the error 256 as well during the process (close to the end). The stick was already bootable, but before the installation of Win10 would start it was asking about a driver for a media device.
So like some of you I tried to unmount, format to NTFS before, etc.
After that I tried to use the CLI too.
I typed:

woeusb --help

and read through the options.
I found the interesting line:

--target-filesystem, --tgt-fs <filesystem name>
Specify the filesystem to use as the target partition's filesystem.
Currently supported: FAT(default)/NTFS

So in the end I tried the following command:

sudo woeusb --device image.iso /dev/sdb --tgt-fs NTFS --verbose

This took a very long time compared to the process via GUI, but in the end it read:

Done :)
The target device should be bootable now

Hooray!
Btw: Installing the GRUB bootloader took ages... (at least with my machine). So don't worry - it'll run through!

eutektoid commented Feb 14, 2018

I wanted to create a bootable Win10-Stick too. At first I used dd (which does not work). Then I came across a tutorial about woeusb.
So I typed into the Terminal:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install woeusb

When I started the program via GUI, I received the error 256 as well during the process (close to the end). The stick was already bootable, but before the installation of Win10 would start it was asking about a driver for a media device.
So like some of you I tried to unmount, format to NTFS before, etc.
After that I tried to use the CLI too.
I typed:

woeusb --help

and read through the options.
I found the interesting line:

--target-filesystem, --tgt-fs <filesystem name>
Specify the filesystem to use as the target partition's filesystem.
Currently supported: FAT(default)/NTFS

So in the end I tried the following command:

sudo woeusb --device image.iso /dev/sdb --tgt-fs NTFS --verbose

This took a very long time compared to the process via GUI, but in the end it read:

Done :)
The target device should be bootable now

Hooray!
Btw: Installing the GRUB bootloader took ages... (at least with my machine). So don't worry - it'll run through!

@houcheng

This comment has been minimized.

Show comment
Hide comment
@houcheng

houcheng Mar 5, 2018

I format the usb stick and un-mount it. Then the installation succeed.

houcheng commented Mar 5, 2018

I format the usb stick and un-mount it. Then the installation succeed.

@watercolorhearts

This comment has been minimized.

Show comment
Hide comment
@watercolorhearts

watercolorhearts May 16, 2018

Installation failed!
Exit code: 256
Log:
WoeUSB v@@WOEUSB_VERSION@@

Error: Target device is currently busy, unmount all mounted partitions in target device then try again
Target device is busy, please make sure you unmount all filesystems on target device or shutdown the computer before detaching it.

I am still getting this error on latest of KDE Neon. How do I unmount a drive?

Installation failed!
Exit code: 256
Log:
WoeUSB v@@WOEUSB_VERSION@@

Error: Target device is currently busy, unmount all mounted partitions in target device then try again
Target device is busy, please make sure you unmount all filesystems on target device or shutdown the computer before detaching it.

I am still getting this error on latest of KDE Neon. How do I unmount a drive?

@MatthewMazaika

This comment has been minimized.

Show comment
Hide comment
@MatthewMazaika

MatthewMazaika Jul 4, 2018

after getting this issue incessantly from the UI, i formatted as NTFS, deleted the new partition, and then ran from commandline and it worked (i'm sure it actually would have worked from the UI as well but i already had the command written up so I just re-ran it)

after getting this issue incessantly from the UI, i formatted as NTFS, deleted the new partition, and then ran from commandline and it worked (i'm sure it actually would have worked from the UI as well but i already had the command written up so I just re-ran it)

@undersound

This comment has been minimized.

Show comment
Hide comment
@undersound

undersound Jul 11, 2018

  1. First I had to umount /media/wherever/your/usb/got/mounted
  2. Then sudo woeusb --device /home/me/Desktop/Win10.iso /dev/sdd
  1. First I had to umount /media/wherever/your/usb/got/mounted
  2. Then sudo woeusb --device /home/me/Desktop/Win10.iso /dev/sdd
@watercolorhearts

This comment has been minimized.

Show comment
Hide comment
@watercolorhearts

watercolorhearts Jul 12, 2018

@undersound

This comment has been minimized.

Show comment
Hide comment
@undersound

undersound Jul 12, 2018

undersound commented Jul 12, 2018

@getSome6

This comment has been minimized.

Show comment
Hide comment
@getSome6

getSome6 Jul 20, 2018

I had the same problem. I formatted the disk, and it still was giving me the same error. Installation failed!

**Exit code: 256
Log:
WoeUSB v@@WOEUSB_VERSION@@

Error: Target device is currently busy, unmount all mounted partitions in target device then try again
Target device is busy, please make sure you unmount all file systems on target device or shutdown the computer before detaching it.**

No matter how I tried to eject it would give me the same message. My guess, is because the flash drive i was using was made to be compatible with Windows Vista through 10. However I am using Ubuntu 15 Therefore when I would try to eject, because of the OS difference, it wouldn't do so completely.

I tried what some of you said you worked, which was download gparted, and unmounted the flash drive using that and after uploading the OS onto the drive worked for me. Prior to that I tried using the cmds listed, and that didn't work either.

Make sure your drive is compatible with your OS. Otherwise use gparted to unmount then try again

I had the same problem. I formatted the disk, and it still was giving me the same error. Installation failed!

**Exit code: 256
Log:
WoeUSB v@@WOEUSB_VERSION@@

Error: Target device is currently busy, unmount all mounted partitions in target device then try again
Target device is busy, please make sure you unmount all file systems on target device or shutdown the computer before detaching it.**

No matter how I tried to eject it would give me the same message. My guess, is because the flash drive i was using was made to be compatible with Windows Vista through 10. However I am using Ubuntu 15 Therefore when I would try to eject, because of the OS difference, it wouldn't do so completely.

I tried what some of you said you worked, which was download gparted, and unmounted the flash drive using that and after uploading the OS onto the drive worked for me. Prior to that I tried using the cmds listed, and that didn't work either.

Make sure your drive is compatible with your OS. Otherwise use gparted to unmount then try again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment